Package org.microproxy.stats
Interface Histogram
- All Superinterfaces:
Metric
A distribution of recorded values in fixed buckets, such as
downstream_rq_time: one
LongAdder per bucket, plus the sum and the count of the
values, so recording takes no lock and allocates nothing. Times are recorded in milliseconds.
A bucket is named by its upper bound, which it includes (Prometheus's le); values
above the last bound fall in the +Inf bucket. The default bounds (defaultBounds()) are Envoy's: 0.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000,
30000, 60000, 300000, 600000, 1800000 and 3600000.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classThe counts of a histogram at one moment.Nested classes/interfaces inherited from interface org.microproxy.stats.Metric
Metric.Type -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]Returns a copy of Envoy's default bucket bounds, in milliseconds.static double[]Returns bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000.voidrecord(double value) Recordsvalue.default voidrecordNanos(long nanos) Records a duration measured in nanoseconds, in milliseconds.snapshot()Returns the counts so far, read bucket by bucket (not atomically as a whole).default Metric.Typetype()Returns what kind of metric this is.Methods inherited from interface org.microproxy.stats.Metric
help, name, tagExtractedName, tags
-
Method Details
-
record
void record(double value) Recordsvalue.- Parameters:
value- the value, in the histogram's unit (milliseconds for times)
-
recordNanos
default void recordNanos(long nanos) Records a duration measured in nanoseconds, in milliseconds.- Parameters:
nanos- the duration in nanoseconds
-
snapshot
Histogram.Snapshot snapshot()Returns the counts so far, read bucket by bucket (not atomically as a whole).- Returns:
- the counts so far, read bucket by bucket (not atomically as a whole)
-
type
Description copied from interface:MetricReturns what kind of metric this is. -
defaultBounds
static double[] defaultBounds()Returns a copy of Envoy's default bucket bounds, in milliseconds.- Returns:
- a copy of Envoy's default bucket bounds, in milliseconds
-
microsecondBounds
static double[] microsecondBounds()Returns bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000.- Returns:
- bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000
-