Count things and emit the sums periodically, or on an event trigger.