sygnal
sygnal copied to clipboard
monitor CPU spent in GC
by hooking into the gc callbacks, we could gather stats on the CPU time spent in the garbage collector (which I suspect is non-trivial), the frequency of garbage-collections, the number of objects being collected, etc.
Synapse currently does the same by disabling automatic GC and periodically running the GC manually https://github.com/matrix-org/synapse/blob/v1.33.0/synapse/metrics/init.py#L589) but I think we can achieve the same thing more elegantly via the callback hooks.
It would be nice to stick this in a library of prometheus extensions.