Snappea Stats

A management command, bugsink-manage showstat snappea-stats can be used to inspect the average and max runtimes of snappea tasks. It displays, per task and time-window, the following information:

  • done/s the number of picked up tasks per second (including failed ones)
  • err/s the number of failed tasks per second
  • wall the “wall time” (time from begin to end) per task. (Average and Max respectively)
  • wait the total time spent waiting on the global write lock of the DB.
  • write the total time spent inside a write transaction
  • sat the fraction of time (max 1) that this task is spending writing to the DB.
  • backlog the max number of unprocessed (backlogged) tasks measured over the time-window

Optional arguments:

  • --window: specify a custom time-window in minutes.
  • --task-name: show stats for a single task (e.g. “digest”) only.

Implementation notes:

The implementation of the Stats mechanism makes a few trade-offs between introducing as little overhead as possible over having 100% up to date and correct info at all times. In particular:

  • Information is only available at 1-minute intervals.
  • When no tasks are running, the information for the last minute when tasks were running is not yet available.
  • Snappea does not store information on shutdown, i.e. the last (partial) minute of information is lost.