public class MeasurementsWrapper extends Object
| Constructor and Description |
|---|
MeasurementsWrapper(MeasurementsService measurementsService) |
| Modifier and Type | Method and Description |
|---|---|
List<Double> |
computeUtilization(OnmsNode node,
String ifName)
This method computes the utilization of a given interface resource.
|
List<Double> |
computeUtilization(String resource,
long start,
long end,
long step,
String aggregation)
This method computes the utilization of a given interface resource.
|
double |
getLastValue(String resource,
String attribute)
Queries the Measuement Api for the last value found in a given timeframe.
|
double |
getLastValue(String resource,
String attribute,
String aggregation)
Queries the Measurement Api for the last value found in a given timeframe.
|
double |
getLastValue(String resource,
String attribute,
String aggregation,
boolean relaxed) |
QueryResponse |
query(QueryRequest request)
Method to query the Measurements Api.
|
List<Double> |
query(String resource,
String attribute,
long start,
long end,
long step,
String aggregation,
boolean relaxed)
A method to query the Measurements Api for a given resource/attribute.
|
public MeasurementsWrapper(MeasurementsService measurementsService)
public double getLastValue(String resource, String attribute) throws MeasurementException
resource - the resource to be usedattribute - the attribute to query forMeasurementExceptionpublic double getLastValue(String resource, String attribute, String aggregation) throws MeasurementException
resource - the resource to be usedattribute - the attribute to query foraggregation - the aggregation methodMeasurementExceptionpublic double getLastValue(String resource, String attribute, String aggregation, boolean relaxed) throws MeasurementException
MeasurementExceptionpublic List<Double> query(String resource, String attribute, long start, long end, long step, String aggregation, boolean relaxed) throws MeasurementException
resource - the resource to be usedattribute - the attribute to query forstart - the start timestampend - the end timestampstep - the step sizeaggregation - the aggregation methodMeasurementExceptionpublic List<Double> computeUtilization(OnmsNode node, String ifName) throws MeasurementException
node - the node to be usedifName - the inteface of the nodeMeasurementExceptionpublic List<Double> computeUtilization(String resource, long start, long end, long step, String aggregation) throws MeasurementException
resource - the resource for which the utilization must be computedstart - the start timestampend - the end timestampstep - the step sizeaggregation - the aggregation functionMeasurementExceptionpublic QueryResponse query(QueryRequest request) throws MeasurementException
request - the request instanceExceptionMeasurementExceptionCopyright © 2021. All rights reserved.