|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataPoints
Represents a read-only sequence of continuous data points.
Implementations of this interface aren't expected to be synchronized.
Method Summary | |
---|---|
int |
aggregatedSize()
Returns the number of data points aggregated in this instance. |
double |
doubleValue(int i)
Returns the value of the i th data point as a float. |
List<String> |
getAggregatedTags()
Returns the tags associated with some but not all of the data points. |
Map<String,String> |
getTags()
Returns the tags associated with these data points. |
boolean |
isInteger(int i)
Tells whether or not the i th value is of integer type. |
SeekableView |
iterator()
Returns a zero-copy view to go through size() data points. |
long |
longValue(int i)
Returns the value of the i th data point as a long. |
String |
metricName()
Returns the name of the series. |
int |
size()
Returns the number of data points. |
long |
timestamp(int i)
Returns the timestamp associated with the i th data point. |
Method Detail |
---|
String metricName()
Map<String,String> getTags()
null
map of tag names (keys), tag values (values).List<String> getAggregatedTags()
When this instance represents the aggregation of multiple time series
(same metric but different tags), getTags()
returns the tags that
are common to all data points (intersection set) whereas this method
returns all the tags names that are not common to all data points (union
set minus the intersection set, also called the symmetric difference).
If this instance does not represent an aggregation of multiple time series, the list returned is empty.
null
list of tag names.int size()
This method must be implemented in O(1)
or O(n)
where n =
.
aggregatedSize()
> 0
int aggregatedSize()
When this instance represents the aggregation of multiple time series
(same metric but different tags), size()
returns the number of data
points after aggregation, whereas this method returns the number of data
points before aggregation.
If this instance does not represent an aggregation of multiple time series, then 0 is returned.
SeekableView iterator()
size()
data points.
The iterator returned must return each DataPoint
in O(1)
.
The DataPoint
returned must not be stored and gets
invalidated as soon as next
is called on the iterator. If you
want to store individual data points, you need to copy the timestamp
and value out of each DataPoint
into your own data structures.
iterator
in interface Iterable<DataPoint>
long timestamp(int i)
i
th data point.
The first data point has index 0.
This method must be implemented in
O(
or better.
aggregatedSize()
)
It is guaranteed that
timestamp(i) < timestamp(i+1)
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
boolean isInteger(int i)
i
th value is of integer type.
The first data point has index 0.
This method must be implemented in
O(
or better.
aggregatedSize()
)
true
if the i
th value is of integer type,
false
if it's of floating point type.
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
long longValue(int i)
i
th data point as a long.
The first data point has index 0.
This method must be implemented in
O(
or better.
Use aggregatedSize()
)iterator()
to get successive O(1)
accesses.
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
ClassCastException
- if the
isInteger(i)
== false
.iterator()
double doubleValue(int i)
i
th data point as a float.
The first data point has index 0.
This method must be implemented in
O(
or better.
Use aggregatedSize()
)iterator()
to get successive O(1)
accesses.
IndexOutOfBoundsException
- if i
is not in the range
[0, size()
- 1]
ClassCastException
- if the
isInteger(i)
== true
.iterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |