state total metric

I'm guessing we're going to want tiny helper functions for parsing state event names and translating labels. Perhaps we should do that refactoring in a separate PR though (or maybe just the next PR when we need them again).