Class LabeledSample

java.lang.Object
io.helidon.metrics.api.LabeledSample
All Implemented Interfaces:
Sample, Sample.Labeled

public class LabeledSample extends Object implements Sample.Labeled
Base implementation of Sample.Labeled.
  • Constructor Details

    • LabeledSample

      protected LabeledSample(double value, String label, long timestamp)
      Create a sample.
      Parameters:
      value - recorded value
      label - label
      timestamp - timestamp
  • Method Details

    • value

      public double value()
      Description copied from interface: Sample.Labeled
      The value.
      Specified by:
      value in interface Sample.Labeled
      Returns:
      value
    • label

      public String label()
      Description copied from interface: Sample.Labeled
      Value label.
      Specified by:
      label in interface Sample.Labeled
      Returns:
      lavel
    • timestamp

      public long timestamp()
      Description copied from interface: Sample.Labeled
      Timestamp the value was recorded.
      Specified by:
      timestamp in interface Sample.Labeled
      Returns:
      timestamp
    • doubleValue

      public double doubleValue()
      Description copied from interface: Sample
      Returns the value as a double.

      For actual samples this serves as a conversion from long to double so all sample types can be treated somewhat uniformly.

      Specified by:
      doubleValue in interface Sample
      Returns:
      value of the sample as a double