Metrics

See here for additional information regarding metrics.

Spell user metrics.

This module is used to log metrics during a Spell run. See send_metric() function for further documentation. When imported outside of a run on Spell’s infrastructure, this module has no effect.

exception SpellMetricWarning

A warning issued if there is an unexpected condition processing a metric

send_metric(name, value, index=None)

Log a metric during a Spell run.

The code must be executed from within a run on Spell’s infrastructure to log the metric. If not executed on Spell’s infrastructure, this function has no effect.

Parameters
  • name (str) – the name of the metric to log

  • value (str, int, or float) – the value of the metric to log

  • index (int, optional) – the index to associate with this value. If omitted, index will be set to 1 + the previous value of index for the metric.