Class TimeseriesFetchStrategy
- java.lang.Object
-
- org.opennms.netmgt.timeseries.sampleread.TimeseriesFetchStrategy
-
- All Implemented Interfaces:
MeasurementFetchStrategy
public class TimeseriesFetchStrategy extends java.lang.Object implements MeasurementFetchStrategy
Used to retrieve measurements fromTimeSeriesStorage
. If a request tofetch(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 theTimeSeriesStorage
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.- Author:
- jwhite
-
-
Field Summary
Fields Modifier and Type Field Description static int
PARALLELISM
-
Constructor Summary
Constructors Constructor Description TimeseriesFetchStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FetchResults
fetch(long start, long end, long step, int maxrows, java.lang.Long interval, java.lang.Long heartbeat, java.util.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)
-
-
-
Method Detail
-
fetch
public FetchResults fetch(long start, long end, long step, int maxrows, java.lang.Long interval, java.lang.Long heartbeat, java.util.List<Source> sources, boolean relaxed)
Description copied from interface:MeasurementFetchStrategy
Fetches the measurements for the given sources.- Specified by:
fetch
in interfaceMeasurementFetchStrategy
- Parameters:
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
- iffalse
a missing source results in a return ofnull
.true
on the other hand ignores that source.- Returns:
- null when a resource id or attribute cannot be found
-
setResourceDao
@Inject protected void setResourceDao(ResourceDao resourceDao)
-
setTimeseriesStorageManager
@Inject protected void setTimeseriesStorageManager(TimeseriesStorageManager timeseriesStorage)
-
setMetricRegistry
@Inject protected void setMetricRegistry(@Named("timeseriesMetricRegistry") com.codahale.metrics.MetricRegistry registry)
-
-