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 avg aggregation 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 metric in in the kv store, fires a metric with the new total using the 'last aggregation 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 last aggregation 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 max aggregation 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 min aggregation 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 sum aggregation method.

Arguments:
  • metric (string) – the name of the metric
  • value (number) – the value of the metric