Package es.urjc.etsii.grafo.metrics
Class MetricUtil
java.lang.Object
es.urjc.etsii.grafo.metrics.MetricUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
areaUnderCurve
(AbstractMetric metric, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.static double
areaUnderCurve
(Objective<?, ?, ?> objective, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.static double
areaUnderCurve
(Class<? extends AbstractMetric> metricType, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.static double
areaUnderCurve
(String metricName, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.
-
Constructor Details
-
MetricUtil
public MetricUtil()
-
-
Method Details
-
areaUnderCurve
public static double areaUnderCurve(Class<? extends AbstractMetric> metricType, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.- Parameters:
metricType
- metric typeskipNanos
- ignore any datapoint whose timestamp is less than (referenceTime+skipNanos).duration
- pick only data points in range [referenceTime+skipNanos, referenceTime+skipNanos+duration]. Range is inclusive.logScale
- Scale area under curve using natural logarithm- Returns:
- area calculation as a double value
- Throws:
IllegalArgumentException
- if the area is unbounded or if the metric does not contain at least 1 datapoint.
-
areaUnderCurve
public static double areaUnderCurve(Objective<?, ?, ?> objective, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.- Parameters:
objective
- objective to use for area calculationskipNanos
- ignore any datapoint whose timestamp is less than (referenceTime+skipNanos).duration
- pick only data points in range [referenceTime+skipNanos, referenceTime+skipNanos+duration]. Range is inclusive.logScale
- Scale area under curve using natural logarithm- Returns:
- area calculation as a double value
- Throws:
IllegalArgumentException
- if the area is unbounded or if the metric does not contain at least 1 datapoint.
-
areaUnderCurve
public static double areaUnderCurve(String metricName, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.- Parameters:
metricName
- metric nameskipNanos
- ignore any datapoint whose timestamp is less than (referenceTime+skipNanos).duration
- pick only data points in range [referenceTime+skipNanos, referenceTime+skipNanos+duration]. Range is inclusive.logScale
- Scale area under curve using natural logarithm- Returns:
- area calculation as a double value
- Throws:
IllegalArgumentException
- if the area is unbounded or if the metric does not contain at least 1 datapoint.
-
areaUnderCurve
public static double areaUnderCurve(AbstractMetric metric, long skipNanos, long duration, boolean logScale) Calculate the area delimited between y = 0 and the given metric, in range [referenceTime+skipNanos, referenceTime+skipNanos+duration] Should be extremely fast, with O(n) complexity, being N the number of data points for the given metric.- Parameters:
metric
- metric instanceskipNanos
- ignore any datapoint whose timestamp is less than (referenceTime+skipNanos).duration
- pick only data points in range [referenceTime+skipNanos, referenceTime+skipNanos+duration]. Range is inclusive.logScale
- Scale area under curve using natural logarithm- Returns:
- area calculation as a double value
- Throws:
IllegalArgumentException
- if the area is unbounded or if the metric does not contain at least 1 datapoint.
-