add metrics to engineAPI#4183
Conversation
|
|
||
| {.push raises: [].} | ||
|
|
||
| declareGauge nec_engine_api_request_duration_ms, |
There was a problem hiding this comment.
time metrics should always be counters that accumulate total time, else a fast call will overwrite a slow call
There was a problem hiding this comment.
also, we typically use toFloatSeconds for this kind of metric
There was a problem hiding this comment.
well the purpose of adding the metrics to engineAPI for now is to detect the exact scenarios which causes the fCU & getPayload call to take longer than usual, which inturn causes sometimes a missed proposal or orphaned block
So for this detection, getting the average time won't really help. So I went with declareGauge for now
There was a problem hiding this comment.
getting the average time
a counter gives cumulative time - if one api request takes 10s and the other takes 2s, the counter will show 12 while the gauge shows 2. You've lost the 10 and the graph will be missing information.
In the case that you call the metrics api often enough, the two are same but if you call it less frequently, a counter loses less information.

No description provided.