Fix bug in group names (again)

pull/931/merge
Dave Syer 11 years ago
parent 49280544b0
commit 59c108a4b0

@ -118,9 +118,9 @@ public class RedisMultiMetricRepository implements MultiMetricRepository {
Set<String> range = this.zSetOperations.range(0, -1);
Collection<String> result = new ArrayList<String>();
for (String key : range) {
result.add(nameFor(this.prefix + key));
result.add(key.substring(this.prefix.length()));
}
return range;
return result;
}
@Override

@ -17,6 +17,7 @@
package org.springframework.boot.actuate.metrics.repository.redis;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -102,7 +103,9 @@ public class RedisMultiMetricRepositoryTests {
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>> asList(new Metric<Number>(
"bar.val", 12.3), new Metric<Number>("bar.foo", 11.3)));
assertEquals(2, Iterables.collection(this.repository.groups()).size());
Collection<String> groups = Iterables.collection(this.repository.groups());
assertEquals(2, groups.size());
assertTrue("Wrong groups: " + groups, groups.contains("foo"));
}
@Test

Loading…
Cancel
Save