ekg icon indicating copy to clipboard operation
ekg copied to clipboard

Add wall clock time and CPU time

Open tomjaguarpaw opened this issue 8 years ago • 3 comments

Could wall clock time and CPU time be added to the ekg output? They would be very helpful.

tomjaguarpaw avatar Jun 28 '16 14:06 tomjaguarpaw

The wall clock time is already there as ekg.server_time_ms. We could add the CPU time as ekg.server_cpu_time or similar. Want to give it a try?

tibbe avatar Jun 29 '16 01:06 tibbe

I don't see ekg.server_time_ms. I do see ekg.server_timestamp_ms, which is not what I want (Although I notice the comment does say ekg.server_time_ms. Is that a mistake?). It seems to be some arbitrary timestamp. I would like to see the elapsed time since the program started running.

Is elapsed time actually missing then? If so I'm happy to try to add it.

tomjaguarpaw avatar Jun 29 '16 08:06 tomjaguarpaw

I think the comment is wrong and it should say ekg.server_timestamp_ms. I have been thinking about adding other metrics, such as scraping /proc on Unix. It should be doable without changing ekg at all. You need to use ekg-core and define e.g. a new group of metrics using registerGroup. registerGroup is for pulling groups of metrics on demand. This is good for things like the current time. You should be able to have registerGroup read /proc and pull out all kinds of interesting metrics. Perhaps you could even publish it as a new ekg package!

tibbe avatar Jun 29 '16 23:06 tibbe