Skip navigation links
Thingworx Platform API
9.0.0
com.thingworx.metrics.builder

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      IStatistic<V,Q> expDecay(java.lang.String key)


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


      Returns a metric that only tracks the last N measurements provided, where N ≤ 500.
      IStatistic<V,Q> uniform(java.lang.String key)


      Returns a uniformly-distributed metric.
    • Method Detail

      • uniform

        @ThingworxExtensionApiMethod(since={8,1,1})
        IStatistic<V,Q> uniform(java.lang.String key)


        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

        @ThingworxExtensionApiMethod(since={8,1,1})
        IStatistic<V,Q> expDecay(java.lang.String key)


        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(java.lang.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