Tag circuits locally by exit vs hidden-service, for stats
If we as a relay see a begin cell on a circuit, we know it's for exiting.
And if we see one of the various hidden service related cells on it, we know it's for hidden services.
And if we see an extend cell, we're a middle (i.e intermediary) hop in a circuit that terminates somewhere else. (assuming nobody uses the leaky pipe topology design, where you can exit from intermediary hops).
How many of each type of circuit do relays of various types handle?
And finally, what privacy risks are there to publishing aggregate ("total over past n seconds") statistics? for various values of n?
One approach to ameliorating the privacy question could be to discard circuits where the previous hop isn't a known relay. I think that's relays in the guard position, and relays in the middle-hop position for users who use bridges.