@Override
			public Void doWithRetry(RetryContext context) {
				return getRedisOperations().execute(new SessionCallback<Void>() {
					@Override
					@SuppressWarnings("unchecked")
					public <K, V> Void execute(RedisOperations<K, V> operations) throws DataAccessException {
						operations.watch((K) key);
						RichGauge g = findOne(name);
						if (g == null) {
							g = new RichGauge(name);
						}

						operations.multi();
						MetricUtils.setRichGaugeValue(g, value, alpha);
						operations.opsForValue().set((K) key, (V) serialize(g));

						List<Object> result = operations.exec();
						if (result == null) {
							throw new OptimisticLockingFailureException(String.format("Failed to set value of rich-gauge '%s' to %f", name, value));
						}
						return null;
					}
				});
			}
Repository for rich-gauges backed by Redis.

@author Luke Taylor
@author Eric Bottard
spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/redis/RedisRichGaugeRepository.java