Class MetricUtil

java.lang.Object
es.urjc.etsii.grafo.metrics.MetricUtil

public class MetricUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 type
      skipNanos - 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 calculation
      skipNanos - 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 name
      skipNanos - 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 instance
      skipNanos - 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.