state total metric

I'll do it in the next PR that I find that I need these functions again.