public class TimeseriesFetchStrategy extends Object implements MeasurementFetchStrategy
TimeSeriesStorage
.
If a request to fetch(long, long, long, int, java.lang.Long, java.lang.Long, java.util.List<org.opennms.netmgt.measurements.model.Source>, boolean)
spans multiple resources, separate calls to
the TimeSeriesStorage
will be performed in parallel.
Reading the samples and computing the aggregated values can be very CPU intensive.
The "parallelism" attribute is used to set an upper limit on how may concurrent threads
can be used to perform these calculations. By default, this is set to the number of
cores, but can be reduced if the operator wishes to ensure cores are available
for other purposes.Modifier and Type | Field and Description |
---|---|
static int |
PARALLELISM |
Constructor and Description |
---|
TimeseriesFetchStrategy() |
Modifier and Type | Method and Description |
---|---|
FetchResults |
fetch(long start,
long end,
long step,
int maxrows,
Long interval,
Long heartbeat,
List<Source> sources,
boolean relaxed)
Fetches the measurements for the given sources.
|
protected void |
setMetricRegistry(com.codahale.metrics.MetricRegistry registry) |
protected void |
setResourceDao(ResourceDao resourceDao) |
protected void |
setTimeseriesStorageManager(TimeseriesStorageManager timeseriesStorage) |
public FetchResults fetch(long start, long end, long step, int maxrows, Long interval, Long heartbeat, List<Source> sources, boolean relaxed)
MeasurementFetchStrategy
fetch
in interface MeasurementFetchStrategy
start
- timestamp in millisecondsend
- timestamp in millisecondsstep
- desired resolution in milliseconds - actual resolution might differmaxrows
- maximum number of rows - no limit when <= 0interval
- duration in milliseconds, used by strategies that implement late aggregationheartbeat
- duration in milliseconds, used by strategies that implement late aggregationsources
- array of sources - these should have unique labelsrelaxed
- if false
a missing source results in a return of null
.
true
on the other hand ignores that source.@Inject protected void setResourceDao(ResourceDao resourceDao)
@Inject protected void setTimeseriesStorageManager(TimeseriesStorageManager timeseriesStorage)
@Inject protected void setMetricRegistry(@Named(value="timeseriesMetricRegistry") com.codahale.metrics.MetricRegistry registry)
Copyright © 2021. All rights reserved.