Metrics¶
-
class
MetricStore(im)¶ Provides metric firing capabilties for the
InteractionMachine().Arguments: - im (InteractionMachine) – the interaction machine to which this sandbox config is associated
-
static
fire(metric, value, agg)¶ Fires a metric.
Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric
- agg (string) – the aggregation method to use
-
static
setup([opts])¶ Sets up the metric store.
Arguments: - opts.store_name – the store/namespace to use for fired metrics. Defaults to ‘default’
-
MetricStore.fire.avg(metric, value)¶ Fires a metric with the
avgaggregation method.Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric
-
MetricStore.fire.inc(metric[, opts])¶ Increments the value for the key
metricin in the kv store, fires a metric with the new total using the'lastaggregation method, then returns the total via a promise.Arguments: - metric (string) – the name of the metric
- opts.amount (number) – the amount to increment by. Defaults to
1.
-
MetricStore.fire.last(metric, value)¶ Fires a metric with the
lastaggregation method.Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric
-
MetricStore.fire.max(metric, value)¶ Fires a metric with the
maxaggregation method.Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric
-
MetricStore.fire.min(metric, value)¶ Fires a metric with the
minaggregation method.Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric
-
MetricStore.fire.sum(metric, value)¶ Fires a metric with the
sumaggregation method.Arguments: - metric (string) – the name of the metric
- value (number) – the value of the metric