Package io.opencensus.metrics.export
Class TimeSeries
- java.lang.Object
-
- io.opencensus.metrics.export.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 aMetric.- Since:
- 0.17
-
-
Constructor Summary
Constructors Constructor Description TimeSeries()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TimeSeriescreate(java.util.List<LabelValue> labelValues)Creates aTimeSerieswith empty(or no) points.static TimeSeriescreate(java.util.List<LabelValue> labelValues, java.util.List<Point> points, Timestamp startTimestamp)Creates aTimeSeries.private static TimeSeriescreateInternal(java.util.List<LabelValue> labelValues, java.util.List<Point> points, Timestamp startTimestamp)Creates aTimeSeries.static TimeSeriescreateWithOnePoint(java.util.List<LabelValue> labelValues, Point point, Timestamp startTimestamp)Creates aTimeSeries.abstract java.util.List<LabelValue>getLabelValues()Returns the set ofLabelValues that uniquely identify thisTimeSeries.abstract java.util.List<Point>getPoints()Returns the dataPoints of thisTimeSeries.abstract TimestampgetStartTimestamp()Returns the startTimestampof thisTimeSeriesif thePoints are cumulative, ornullif thePoints are gauge.TimeSeriessetPoint(Point point)Sets thePointof theTimeSeries.
-
-
-
Method Detail
-
create
public static TimeSeries create(java.util.List<LabelValue> labelValues, java.util.List<Point> points, @Nullable Timestamp startTimestamp)
Creates aTimeSeries.- Parameters:
labelValues- theLabelValues that uniquely identify thisTimeSeries.points- the dataPoints of thisTimeSeries.startTimestamp- the startTimestampof thisTimeSeries. Must be non-null for cumulativePoints.- Returns:
- a
TimeSeries. - Since:
- 0.17
-
create
public static TimeSeries create(java.util.List<LabelValue> labelValues)
Creates aTimeSerieswith empty(or no) points.- Parameters:
labelValues- theLabelValues that uniquely identify thisTimeSeries.- Returns:
- a
TimeSeries. - Since:
- 0.17
-
createWithOnePoint
public static TimeSeries createWithOnePoint(java.util.List<LabelValue> labelValues, Point point, @Nullable Timestamp startTimestamp)
Creates aTimeSeries.- Parameters:
labelValues- theLabelValues that uniquely identify thisTimeSeries.point- the single dataPointof thisTimeSeries.startTimestamp- the startTimestampof thisTimeSeries. Must be non-null for cumulativePoints.- Returns:
- a
TimeSeries. - Since:
- 0.17
-
setPoint
public TimeSeries setPoint(Point point)
Sets thePointof theTimeSeries.- Parameters:
point- the single dataPointof thisTimeSeries.- 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 aTimeSeries.- Parameters:
labelValues- theLabelValues that uniquely identify thisTimeSeries.points- the dataPoints of thisTimeSeries.startTimestamp- the startTimestampof thisTimeSeries. Must be non-null for cumulativePoints.- Returns:
- a
TimeSeries.
-
getLabelValues
public abstract java.util.List<LabelValue> getLabelValues()
Returns the set ofLabelValues that uniquely identify thisTimeSeries.Apply to all
Points.The order of
LabelValues must match that ofLabelKeys in theMetricDescriptor.- Returns:
- the
LabelValues. - Since:
- 0.17
-
getPoints
public abstract java.util.List<Point> getPoints()
Returns the dataPoints of thisTimeSeries.- Returns:
- the data
Points. - Since:
- 0.17
-
getStartTimestamp
@Nullable public abstract Timestamp getStartTimestamp()
Returns the startTimestampof thisTimeSeriesif thePoints are cumulative, ornullif thePoints are gauge.- Returns:
- the start
Timestampornull. - Since:
- 0.17
-
-