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 forMeasurementException
public double getLastValue(String resource, String attribute, String aggregation) throws MeasurementException
resource
- the resource to be usedattribute
- the attribute to query foraggregation
- the aggregation methodMeasurementException
public double getLastValue(String resource, String attribute, String aggregation, boolean relaxed) throws MeasurementException
MeasurementException
public 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 methodMeasurementException
public List<Double> computeUtilization(OnmsNode node, String ifName) throws MeasurementException
node
- the node to be usedifName
- the inteface of the nodeMeasurementException
public 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 functionMeasurementException
public QueryResponse query(QueryRequest request) throws MeasurementException
request
- the request instanceException
MeasurementException
Copyright © 2021. All rights reserved.