Records a distribution of values (e.g., sizes of responses returned by a server).
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.metrics.api.Meter
Meter.BaseUnits, Meter.Id, Meter.Scope, Meter.Type
-
Method Summary
Modifier and TypeMethodDescriptionstatic DistributionSummary.Builder
Creates a builder for a newDistributionSummary
using default distribution statistics.static DistributionSummary.Builder
builder
(String name, DistributionStatisticsConfig.Builder configBuilder) Creates a builder for a newDistributionSummary
using the specified statistics builder.long
count()
Returns the current count of observations in the distribution summary.double
max()
Returns the maximum value among the observations recorded by the distribution summary.double
mean()
Returns the mean of the observations recorded by the distribution summary.void
record
(double amount) Updates the statistics kept by the summary with the specified amount.snapshot()
Returns aHistogramSnapshot
of the current state of the distribution summary.double
Returns the total of the observations recorded by the distribution summary.
-
Method Details
-
builder
static DistributionSummary.Builder builder(String name, DistributionStatisticsConfig.Builder configBuilder) Creates a builder for a newDistributionSummary
using the specified statistics builder.- Parameters:
name
- name for the summaryconfigBuilder
- distribution stats config for the summary- Returns:
- new builder
-
builder
Creates a builder for a newDistributionSummary
using default distribution statistics.- Parameters:
name
- name for the summary- Returns:
- new builder
-
record
void record(double amount) Updates the statistics kept by the summary with the specified amount.- Parameters:
amount
- Amount for an event being measured. For example, if the size in bytes of responses from a server. If the amount is less than 0 the value will be dropped.
-
count
long count()Returns the current count of observations in the distribution summary.- Returns:
- number of observations recorded in the summary
-
totalAmount
double totalAmount()Returns the total of the observations recorded by the distribution summary.- Returns:
- total across all recorded events
-
mean
double mean()Returns the mean of the observations recorded by the distribution summary.- Returns:
- average value of events recorded in the summary
-
max
double max()Returns the maximum value among the observations recorded by the distribution summary.- Returns:
- maximum value of recorded events
-
snapshot
HistogramSnapshot snapshot()Returns aHistogramSnapshot
of the current state of the distribution summary.- Returns:
- snapshot
-