use of com.google.gerrit.metrics.Counter0 in project gerrit by GerritCodeReview.
the class ProcMetricModuleTest method counter0.
@Test
public void counter0() {
Counter0 cntr = metrics.newCounter("test/count", new Description("simple test").setCumulative());
Counter raw = get("test/count", Counter.class);
assertThat(raw.getCount()).isEqualTo(0);
cntr.increment();
assertThat(raw.getCount()).isEqualTo(1);
cntr.incrementBy(5);
assertThat(raw.getCount()).isEqualTo(6);
}
use of com.google.gerrit.metrics.Counter0 in project gerrit by GerritCodeReview.
the class PluginMetricMaker method newCounter.
@Override
public Counter0 newCounter(String name, Description desc) {
Counter0 m = root.newCounter(prefix + name, desc);
cleanup.add(m);
return m;
}
Aggregations