Skip to content

Event loop load metrics #322

Open
Open
@Tinche

Description

@Tinche

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions