In the past few weeks, a situation has occurred several times when I would like to measure some kind of event that can happen regularly (for example, the time taken to redraw a frame in a 2D smoothly scrollable interface) or a variable frequency (like a message arriving at an endpoint webservice). I had an idea to measure 1) the "normal" frequency, 2) the current frequency, 3) min, 4) max. And I would like to measure them over several buckets of time.
For example, a webservice can receive 10 messages in 100 ms and then not receive messages for 5 minutes. In the user interface example, it can operate at 60 FPS for 10 seconds in a row, then the GC hits, and one frame can be “frozen” for 1 second, which completely destroys the effect of the user interface.
I think that such measurements could be made using a set of "buckets" to collect measurements. But unlike time series , the FPS measurement that I care most about is the one that SHOULD NOT arrive at the normal interval (normal in the UI example, one frame drawn every 1/60 second, but the one I care about, 60 times longer). Therefore, in order to be useful both in the ordinary case and in the exceptional case, it was possible to use a hierarchy of "sampling".
1.10 'micro "buckets, each 1/10 second each;
many" micro "buckets are needed to provide an accurate sliding window at a" normal "level
1..60 'normal' buckets, every 1 second
1..60 "macro commands", every 1 min
... levels can go on: hours, days, months, years
Many indicators (avg, min, max, count) can be stored on each bucket at each level. When the time period for the bucket expires, the bucket can be “advanced” to the next level and combined into a “sampling queue” at this level. This would ensure an accurate sliding window of each unit per bucket at each level in the hierarchy when using a relatively small amount of CPU or memory.
, "" . "" , "" ( ). , , (, ) (, GC ).
, , , , ( , ,.NET). , , ? ?
P.S. - , PerformanceCounters Windows "" ( , , , , UI FPS). , Mono Silverlight ( PerfCounters).
P.P.S. .NET , " ", . , , , , .