@Test public void testQuantiles() { int nSamples = 1000000; for (int i=1; i<=nSamples; i++) { labelsAndQuantiles.labels("a").observe(i); noLabelsAndQuantiles.observe(i); } assertEquals(getNoLabelQuantile(0.5), 0.5 * nSamples, 0.05 * nSamples); assertEquals(getNoLabelQuantile(0.9), 0.9 * nSamples, 0.01 * nSamples); assertEquals(getNoLabelQuantile(0.99), 0.99 * nSamples, 0.001 * nSamples); assertEquals(getLabeledQuantile("a", 0.5), 0.5 * nSamples, 0.05 * nSamples); assertEquals(getLabeledQuantile("a", 0.9), 0.9 * nSamples, 0.01 * nSamples); assertEquals(getLabeledQuantile("a", 0.99), 0.99 * nSamples, 0.001 * nSamples); }
public void observe(double amt) { noLabelsChild.observe(amt); }
Summary extends SimpleCollector<Summary.Child> implements Counter.Describable { public void observe(double amt) { noLabelsChild.observe(amt); } }
Summary extends SimpleCollector<Summary.Child> implements Counter.Describable { public void observe(double amt) { noLabelsChild.observe(amt); } Summary(Builder b); }
Summary extends SimpleCollector<Summary.Child> implements Counter.Describable { public void observe(double amt) { noLabelsChild.observe(amt); } Summary(Builder b); static Builder build(String name, String help); static Builder build(); void observe(double amt); Timer startTimer(); double time(Runnable timeable); E time(Callable<E> timeable); Child.Value get(); @Override List<MetricFamilySamples> collect(); @Override List<MetricFamilySamples> describe(); }
Summary extends SimpleCollector<Summary.Child> implements Counter.Describable { public void observe(double amt) { noLabelsChild.observe(amt); } Summary(Builder b); static Builder build(String name, String help); static Builder build(); void observe(double amt); Timer startTimer(); double time(Runnable timeable); E time(Callable<E> timeable); Child.Value get(); @Override List<MetricFamilySamples> collect(); @Override List<MetricFamilySamples> describe();  }