public class InvalidMetricsManager extends Object
This class tries to deal with invalid aggregate metrics. An invalid metric is one where either min > avg or max < avg. There are a couple different bugs which made these situations possible See https://bugzilla.redhat.com/show_bug.cgi?id=1110462 and https://bugzilla.redhat.com/show_bug.cgi?id=1104885 for details.
When an invalid metric is found, it is submitted
to an internal queue for later processing. Metrics will be recomputed if possible;
otherwise, they will be deleted.
| Constructor and Description |
|---|
InvalidMetricsManager(DateTimeService dateTimeService,
MetricsDAO dao) |
| Modifier and Type | Method and Description |
|---|---|
DelayQueue<org.rhq.server.metrics.invalid.InvalidMetric> |
getQueue()
This is a test hook
|
boolean |
isInvalidMetric(AggregateNumericMetric metric) |
void |
shutdown()
Shuts down the executor, waiting for any in progress work to finish.
|
boolean |
submit(AggregateNumericMetric metric)
Submits an invalid metric for later processing which is done in a separate thread.
|
public InvalidMetricsManager(DateTimeService dateTimeService, MetricsDAO dao)
public void shutdown()
public boolean submit(AggregateNumericMetric metric)
InvalidMetric. Metrics belonging to
the same measurement schedule and from the same day will only have one invalid metric
stored in the queue. In other words, suppose a 1 hour metric from 14:00 is submitted.
Then a 6 hour metric from 12:00 for the same schedule id is submitted. This will result
in only one InvalidMetric stored stored in the queue. The reason being that
we need to look at all of the 1 hour, 6 hour, and 24 hour metrics; so, multiple
entries in the queue for the same day will only result in duplicate work.metric - The invalid metric where invalid means either min > avg or max < avgpublic DelayQueue<org.rhq.server.metrics.invalid.InvalidMetric> getQueue()
public boolean isInvalidMetric(AggregateNumericMetric metric)
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.