Class TimeSeries

java.lang.Object
io.opencensus.metrics.export.TimeSeries
Direct Known Subclasses:
AutoValue_TimeSeries

@ExperimentalApi @Immutable public abstract class TimeSeries extends Object
A collection of data points that describes the time-varying values of a Metric.
Since:
0.17
  • Constructor Details

    • TimeSeries

      TimeSeries()
  • Method Details

    • create

      public static TimeSeries create(List<LabelValue> labelValues, List<Point> points, @Nullable Timestamp startTimestamp)
      Creates a TimeSeries.
      Parameters:
      labelValues - the LabelValues that uniquely identify this TimeSeries.
      points - the data Points of this TimeSeries.
      startTimestamp - the start Timestamp of this TimeSeries. Must be non-null for cumulative Points.
      Returns:
      a TimeSeries.
      Since:
      0.17
    • create

      public static TimeSeries create(List<LabelValue> labelValues)
      Creates a TimeSeries with empty(or no) points.
      Parameters:
      labelValues - the LabelValues that uniquely identify this TimeSeries.
      Returns:
      a TimeSeries.
      Since:
      0.17
    • createWithOnePoint

      public static TimeSeries createWithOnePoint(List<LabelValue> labelValues, Point point, @Nullable Timestamp startTimestamp)
      Creates a TimeSeries.
      Parameters:
      labelValues - the LabelValues that uniquely identify this TimeSeries.
      point - the single data Point of this TimeSeries.
      startTimestamp - the start Timestamp of this TimeSeries. Must be non-null for cumulative Points.
      Returns:
      a TimeSeries.
      Since:
      0.17
    • setPoint

      public TimeSeries setPoint(Point point)
      Sets the Point of the TimeSeries.
      Parameters:
      point - the single data Point of this TimeSeries.
      Returns:
      a TimeSeries.
      Since:
      0.17
    • createInternal

      private static TimeSeries createInternal(List<LabelValue> labelValues, List<Point> points, @Nullable Timestamp startTimestamp)
      Creates a TimeSeries.
      Parameters:
      labelValues - the LabelValues that uniquely identify this TimeSeries.
      points - the data Points of this TimeSeries.
      startTimestamp - the start Timestamp of this TimeSeries. Must be non-null for cumulative Points.
      Returns:
      a TimeSeries.
    • getLabelValues

      public abstract List<LabelValue> getLabelValues()
      Returns the set of LabelValues that uniquely identify this TimeSeries.

      Apply to all Points.

      The order of LabelValues must match that of LabelKeys in the MetricDescriptor.

      Returns:
      the LabelValues.
      Since:
      0.17
    • getPoints

      public abstract List<Point> getPoints()
      Returns the data Points of this TimeSeries.
      Returns:
      the data Points.
      Since:
      0.17
    • getStartTimestamp

      @Nullable public abstract Timestamp getStartTimestamp()
      Returns the start Timestamp of this TimeSeries if the Points are cumulative, or null if the Points are gauge.
      Returns:
      the start Timestamp or null.
      Since:
      0.17