Class AbstractDistributionSummary

java.lang.Object
io.micrometer.core.instrument.AbstractMeter
io.micrometer.core.instrument.AbstractDistributionSummary
All Implemented Interfaces:
HistogramSupport, DistributionSummary, Meter
Direct Known Subclasses:
CumulativeDistributionSummary, DropwizardDistributionSummary, StepDistributionSummary

public abstract class AbstractDistributionSummary extends AbstractMeter implements DistributionSummary
  • Field Details

    • histogram

      protected final Histogram histogram
  • Constructor Details

    • AbstractDistributionSummary

      protected AbstractDistributionSummary(Meter.Id id, Clock clock, DistributionStatisticConfig distributionStatisticConfig, double scale, boolean supportsAggregablePercentiles)
    • AbstractDistributionSummary

      protected AbstractDistributionSummary(Meter.Id id, double scale, @Nullable Histogram histogram)
      Creates an AbstractDistributionSummary instance.
      Parameters:
      id - meter ID
      scale - scale
      histogram - histogram
      Since:
      1.11.0
  • Method Details

    • defaultHistogram

      protected static Histogram defaultHistogram(Clock clock, DistributionStatisticConfig distributionStatisticConfig, boolean supportsAggregablePercentiles)
      Creates a default histogram.
      Parameters:
      clock - clock
      distributionStatisticConfig - distribution statistic configuration
      supportsAggregablePercentiles - whether to support aggregable percentiles
      Returns:
      a default histogram
      Since:
      1.11.0
    • record

      public final void record(double amount)
      Description copied from interface: DistributionSummary
      Updates the statistics kept by the summary with the specified amount.
      Specified by:
      record in interface DistributionSummary
      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.
    • recordNonNegative

      protected abstract void recordNonNegative(double amount)
    • takeSnapshot

      public HistogramSnapshot takeSnapshot()
      Description copied from interface: HistogramSupport
      Summary statistics should be published off of a single snapshot instance so that, for example, there isn't disagreement between the distribution's bucket counts because more events continue to stream in.
      Specified by:
      takeSnapshot in interface HistogramSupport
      Returns:
      A snapshot of all distribution statistics at a point in time.