Java 类org.springframework.boot.actuate.metrics.Iterables 实例源码
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGet() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
assertThat(Iterables.collection(this.repository.findAll("foo")).iterator().next()
.getValue()).isEqualTo(15.3);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGetMultiple() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.val", 12.3),
new Metric<Number>("foo.bar", 11.3)));
assertThat(Iterables.collection(this.repository.findAll("foo"))).hasSize(2);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:PrefixMetricGroupExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:PrefixMetricGroupExporterTests.java
@Test
public void unprefixedMetricsNotCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("bar"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).isEmpty();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:PrefixMetricGroupExporterTests.java
@Test
public void multiMetricGroupsCopiedAsDefault() {
this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
new Metric<Number>("spam", 1.3)));
this.exporter.export();
assertThat(this.writer.countGroups()).isEqualTo(1);
assertThat(Iterables.collection(this.writer.findAll("foo"))).hasSize(2);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:PrefixMetricGroupExporterTests.java
@Test
public void onlyPrefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.reader.set(new Metric<Number>("foobar.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:spring-boot-concourse
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGet() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
assertThat(Iterables.collection(this.repository.findAll("foo")).iterator().next()
.getValue()).isEqualTo(15.3);
}
项目:spring-boot-concourse
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGetMultiple() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.val", 12.3),
new Metric<Number>("foo.bar", 11.3)));
assertThat(Iterables.collection(this.repository.findAll("foo"))).hasSize(2);
}
项目:spring-boot-concourse
文件:PrefixMetricGroupExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:spring-boot-concourse
文件:PrefixMetricGroupExporterTests.java
@Test
public void unprefixedMetricsNotCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("bar"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).isEmpty();
}
项目:spring-boot-concourse
文件:PrefixMetricGroupExporterTests.java
@Test
public void multiMetricGroupsCopiedAsDefault() {
this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
new Metric<Number>("spam", 1.3)));
this.exporter.export();
assertThat(this.writer.countGroups()).isEqualTo(1);
assertThat(Iterables.collection(this.writer.findAll("foo"))).hasSize(2);
}
项目:spring-boot-concourse
文件:PrefixMetricGroupExporterTests.java
@Test
public void onlyPrefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.reader.set(new Metric<Number>("foobar.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:contestparser
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGet() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
assertEquals(15.3, Iterables.collection(this.repository.findAll("foo")).iterator()
.next().getValue());
}
项目:contestparser
文件:RedisMultiMetricRepositoryTests.java
@Test
public void setAndGetMultiple() {
this.repository.set("foo",
Arrays.<Metric<?>>asList(new Metric<Number>("foo.val", 12.3),
new Metric<Number>("foo.bar", 11.3)));
assertEquals(2, Iterables.collection(this.repository.findAll("foo")).size());
}
项目:contestparser
文件:PrefixMetricGroupExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertEquals(1, Iterables.collection(this.writer.groups()).size());
}
项目:contestparser
文件:PrefixMetricGroupExporterTests.java
@Test
public void unprefixedMetricsNotCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.exporter.setGroups(Collections.singleton("bar"));
this.exporter.export();
assertEquals(0, Iterables.collection(this.writer.groups()).size());
}
项目:contestparser
文件:PrefixMetricGroupExporterTests.java
@Test
public void multiMetricGroupsCopiedAsDefault() {
this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
new Metric<Number>("spam", 1.3)));
this.exporter.export();
assertEquals(1, this.writer.countGroups());
assertEquals(2, Iterables.collection(this.writer.findAll("foo")).size());
}
项目:contestparser
文件:PrefixMetricGroupExporterTests.java
@Test
public void onlyPrefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo.bar", 2.3));
this.reader.set(new Metric<Number>("foo.spam", 1.3));
this.reader.set(new Metric<Number>("foobar.spam", 1.3));
this.exporter.setGroups(Collections.singleton("foo"));
this.exporter.export();
assertEquals(1, Iterables.collection(this.writer.groups()).size());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RedisMetricRepositoryTests.java
@Test
public void findAll() {
this.repository.increment(new Delta<Long>("foo", 3L));
this.repository.set(new Metric<Number>("bar", 12.3));
assertThat(Iterables.collection(this.repository.findAll())).hasSize(2);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot
文件:RichGaugeExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo", 2.3));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:spring-boot-concourse
文件:RedisMetricRepositoryTests.java
@Test
public void findAll() {
this.repository.increment(new Delta<Long>("foo", 3L));
this.repository.set(new Metric<Number>("bar", 12.3));
assertThat(Iterables.collection(this.repository.findAll())).hasSize(2);
}
项目:spring-boot-concourse
文件:RichGaugeExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo", 2.3));
this.exporter.export();
assertThat(Iterables.collection(this.writer.groups())).hasSize(1);
}
项目:contestparser
文件:RedisMetricRepositoryTests.java
@Test
public void findAll() {
this.repository.increment(new Delta<Long>("foo", 3L));
this.repository.set(new Metric<Number>("bar", 12.3));
assertEquals(2, Iterables.collection(this.repository.findAll()).size());
}
项目:contestparser
文件:RichGaugeExporterTests.java
@Test
public void prefixedMetricsCopied() {
this.reader.set(new Metric<Number>("foo", 2.3));
this.exporter.export();
assertEquals(1, Iterables.collection(this.writer.groups()).size());
}