Sexy Counters: "samples"

This defines an API for declarative sample-based meta counters

That, is you can now do something like:
  from sparts.sparts import samples, SampleType

  class MyTask(PeriodicTask):
      interval = 10
      execute_duration = samples(windows=[60, 240], types=[SampleType.AVG])
      def execute(self):
          t0 = time.time()
          # Something expensive
          self.execute_duration.add(time.time() - t0)

This will generate some counters like:

  {"MyTask.avg.60": 10.5,
   "MyTask.avg.240": 16.2}