Description
Hello!
First, the motivation. We're running a fair number of asyncio services in production, and I'm trying to figure out how to expose some sort of load metrics. These metrics would be useful for tweaking and autoscaling said services. We're using UVLoop, of course (thank you very much!).
I think exposing a busyness factor from the event loop would be a very interesting notion. Something like the percentage of the time in the last n seconds or so that the loop was idle: no tasks to switch to, just waiting on external inputs.
I guess I was looking for something sort of similar to #267. I'm not sure it should be a debug build feature though, since these metrics are most important in a high load production environment, where you want your libraries operating at max efficiency.
I think over at that issue it was mentioned that UVLoop should have little to no non-asyncio functionality, so my first question is: should I take this discussion over to python-dev instead? My instinct was to first try proving the concept in a third party implementation, then see about making it part of the official API.