KeyType
- can be a class or object defined by the user that stores information about a MetricDatum needed
by the user.
The following is a example of what a KeyType class might look like:
class SampleKeyType {
private long timeKeyCreated;
private MetricDatum datum;
public SampleKeyType(long timeKeyCreated, MetricDatum datum){
this.timeKeyCreated = timeKeyCreated;
this.datum = datum;
}
}public class MetricAccumulatingQueue<KeyType> extends Object
Constructor and Description |
---|
MetricAccumulatingQueue(int maxQueueSize) |
Modifier and Type | Method and Description |
---|---|
List<MetricDatumWithKey<KeyType>> |
drain(int maxItems) |
boolean |
isEmpty() |
boolean |
offer(KeyType key,
software.amazon.awssdk.services.cloudwatch.model.MetricDatum datum)
We use a queue and a map in this method.
|
int |
size() |
public List<MetricDatumWithKey<KeyType>> drain(int maxItems)
maxItems
- number of items to remove from the queue.public boolean isEmpty()
public int size()
public boolean offer(KeyType key, software.amazon.awssdk.services.cloudwatch.model.MetricDatum datum)
key
- metric key to be inserted into queuedatum
- metric to be inserted into queueCopyright © 2019. All rights reserved.