E
- The entity class. Note that the entity will be used as a key to HashMaps, so it must have
a valid Object.hashCode()
and Object.equals(Object)
implementation.public class MetricSampleAggregationResult<E extends Entity> extends LongGenerationed
MetricSampleAggregator.aggregate(long, long, AggregationOptions)
.
In the aggregation result, each entity will be represented with a ValuesAndExtrapolations
. It contains
the values of each metric in each window. For memory efficiency the metric values are stored in a two-dimensional
array. To get the window associated with each value, users may use the time window array returned by
ValuesAndExtrapolations.windows()
, or call ValuesAndExtrapolations.window(int)
to get the time window
in milliseconds for the index.
generation
Constructor and Description |
---|
MetricSampleAggregationResult(long generation,
MetricSampleCompleteness<E> completeness) |
Modifier and Type | Method and Description |
---|---|
MetricSampleCompleteness<E> |
completeness()
Get the completeness summary of this aggregation result.
|
Set<E> |
invalidEntities()
Get the entities that are not valid.
|
Map<E,ValuesAndExtrapolations> |
valuesAndExtrapolations()
Get the aggregated metric values and extrapolations (if any) of each entity.
|
generation
public MetricSampleAggregationResult(long generation, MetricSampleCompleteness<E> completeness)
public Map<E,ValuesAndExtrapolations> valuesAndExtrapolations()
public Set<E> invalidEntities()
AggregationOptions
when MetricSampleAggregator.aggregate(long, long, AggregationOptions)
is invoked. Some of those entities may not be valid (see MetricSampleAggregator
). Those entities
are considered as invalid entities.
The invalid entities returned by this method is not a complementary set of the entities returned by
MetricSampleCompleteness.validEntities()
. The covered entities in MetricSampleCompleteness
are the entities that meet the completeness requirement in AggregationOptions
. It is possible for
an entity to be valid but excluded from the MetricSampleCompleteness.validEntities()
. For example,
If the AggregationOptions
specifies aggregation granularity to be
AggregationOptions.Granularity.ENTITY_GROUP
and an entity belongs to a group which has
other invalid entities. In this case, entity itself is still a valid entity therefore it will
not be in the set returned by this method. But since the entity group does not meet the completeness
requirement, the entire entity group is not considered as "covered". So entity will not
be included in the MetricSampleCompleteness.validEntities()
either.
public MetricSampleCompleteness<E> completeness()
MetricSampleCompleteness