Histogram instrument that records values of type A.
Histogram metric data points convey a population of recorded measurements in a compressed format. A histogram bundles a set of events into divided populations with an overall event count and aggregate sum for all events.
Type Signature
F[_]- the higher-kinded type of a polymorphic effectA- the type of values to record. Must have aMeasurementValueinstance.LongandDoubleare supported out of the box.
Creating a Histogram
Histograms are created using theMeter API:
Backend Methods
record
Records a value with a set of attributes.The value to record.
The set of attributes to associate with the value.
F[Unit]
Example:
recordDuration
Records the duration of a given effect.The time unit of the duration measurement.
A function to build the set of attributes based on the exit case.
Resource[F, Unit]
Example:
Builder Methods
withUnit
Sets the unit of measure for this histogram.The measurement unit. Must be 63 or fewer ASCII characters.
Histogram.Builder[F, A]
Reference: Instrument Unit
withDescription
Sets the description for this histogram.The description of the histogram.
Histogram.Builder[F, A]
Reference: Instrument Description
withExplicitBucketBoundaries
Sets the explicit bucket boundaries for this histogram.The bucket boundaries to use for the histogram.
Histogram.Builder[F, A]
Reference: Explicit Bucket Boundaries
create
Creates aHistogram with the configured unit, description, and bucket boundaries.
Returns: F[Histogram[F, A]]
Helper Methods
causeAttributes
Utility function to extract cause attributes from aResource.ExitCase.
Type Signature:
- Empty list for
ExitCase.Succeeded Attribute("cause", className)forExitCase.ErroredAttribute("cause", "canceled")forExitCase.Canceled