Interface IStatisticBuilder<V,Q>

Type Parameters:
V - the type of value that is fed into the metric
Q - the type returned for quantiles

@ThingworxExtensionApiClass(since={8,1,1}) public interface IStatisticBuilder<V,Q>
Builds a statistic metric based on the type selected.
  • Method Summary

    Modifier and Type
    Method
    Description


    Returns a statistical metric that uses an exponential decay algorithm to weigh metrics more heavily towards newer data points.
    lastN(String key, int n)


    Returns a metric that only tracks the last N measurements provided, where N ≤ 500.


    Returns a uniformly-distributed metric.
  • Method Details

    • uniform



      Returns a uniformly-distributed metric. Uniform distribution is appropriate for metrics that are relevant over the lifespan of the Platform, where all data points should be accounted for.
      Parameters:
      key - the metric key
      Returns:
      a uniformly-distributed metric
    • expDecay



      Returns a statistical metric that uses an exponential decay algorithm to weigh metrics more heavily towards newer data points. This is recommended when you only want statistics that are relevant for approximately the last five minutes of Platform execution.
      Parameters:
      key - the metric key
      Returns:
      an exponentially-decaying metric
    • lastN

      @ThingworxExtensionApiMethod(since={8,1,1}) IStatistic<V,Q> lastN(String key, int n)


      Returns a metric that only tracks the last N measurements provided, where N ≤ 500. Once (N + 1) measurements are fed, the first measurement will be dropped and no longer factored into the statistics.
      Parameters:
      key - the metric key
      n - the number of values to track
      Returns:
      a windowed metric