I'm investigating an IO-boundedness issue with a python server, and would like to instrument the uvloop to compute the amount of time spent polling for IO.
The way to do this in libuv would be to register a prepare handle that records the start_time and a check handle that records the the stop_time and writes it to some form of global state. I went through the UVLoop code, and there seems to be no way to register custom check or prepare handles.
Is there another cleaner way to do this? I suppose I could subclass uvloop.Loop and register the handles myself, but that seems to be a fairly ugly approach.
I'm investigating an IO-boundedness issue with a python server, and would like to instrument the uvloop to compute the amount of time spent polling for IO.
The way to do this in
libuvwould be to register apreparehandle that records thestart_timeand acheckhandle that records the thestop_timeand writes it to some form of global state. I went through the UVLoop code, and there seems to be no way to register customcheckorpreparehandles.Is there another cleaner way to do this? I suppose I could subclass
uvloop.Loopand register the handles myself, but that seems to be a fairly ugly approach.