Add an event to a given accumulator. :param key: category to which the event should be added. :param value: value of the event.
(self, key, value)
| 70 | """ |
| 71 | |
| 72 | def add(self, key, value): |
| 73 | """Add an event to a given accumulator. |
| 74 | |
| 75 | :param key: category to which the event should be added. |
| 76 | :param value: value of the event. |
| 77 | """ |
| 78 | if key in self: |
| 79 | super().__getitem__(key).add(value) |
| 80 | else: |
| 81 | super().__setitem__(key, RunningState(value)) |
| 82 | |
| 83 | def stats(self, key): |
| 84 | """Return the statistics for the current accumulator. |