swh.indexer.storage.metrics module#

swh.indexer.storage.metrics.timed(f)[source]#

Time that function!

swh.indexer.storage.metrics.send_metric(metric, count, method_name)[source]#

Send statsd metric with count for method method_name

If count is 0, the metric is discarded. If the metric is not parseable, the metric is discarded with a log message.

Parameters:
  • metric (str) – Metric’s name (e.g content:add, content:add:bytes)

  • count (int) – Associated value for the metric

  • method_name (str) – Method’s name

Returns:

Bool to explicit if metric has been set or not

swh.indexer.storage.metrics.process_metrics(f)[source]#

Increment object counters for the decorated function.