use of org.opennms.netmgt.measurements.impl.AbstractRrdBasedFetchStrategy in project opennms by OpenNMS.
the class CustomSpringConfiguration method createFetchStrategy.
@Bean(name = "measurementFetchStrategy")
public MeasurementFetchStrategy createFetchStrategy() {
return new AbstractRrdBasedFetchStrategy() {
@Override
protected FetchResults fetchMeasurements(long start, long end, long step, int maxrows, Map<Source, String> rrdsBySource, Map<String, Object> constants) throws RrdException {
final long[] timestamps = new long[] { start, end };
final Map columnMap = new HashMap<>();
if (!rrdsBySource.isEmpty()) {
for (Source eachKey : rrdsBySource.keySet()) {
columnMap.put(eachKey.getLabel(), new double[] { 13, 17 });
}
}
return new FetchResults(timestamps, columnMap, step, constants);
}
};
}
Aggregations