Class TimeSeries

  • Direct Known Subclasses:
    AutoValue_TimeSeries

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

      • TimeSeries

        TimeSeries()
    • Method Detail

      • create

        public static TimeSeries create​(java.util.List<LabelValue> labelValues,
                                        java.util.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​(java.util.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​(java.util.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​(java.util.List<LabelValue> labelValues,
                                                 java.util.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 java.util.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 java.util.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