599166320 commented on PR #13034:
URL: https://github.com/apache/druid/pull/13034#issuecomment-1240756583

   > Sorry, I see now that I did not use precise language. My concern was not 
the map of registered metrics itself, because once initialized, it is never 
updated, only read from. But it does not hurt to have this as an unmodifiable 
map.
   > 
   > My actual concern was regarding `DimensionsAndCollector` objects.
   > 
   > 1. Let's say there are 2 registered metrics.
   > 2. A `flush` event comes and the thread starts to read the metrics and has 
finished reading the value of the first metric.
   > 3. Then `emit` event comes and updates the value of the second metric in 
the respective `DimensionsAndCollector` object.
   > 4. `flush` thread then reads the value of the second metric.
   > 5. `flush` thread pushes the old value of first metric but a new value of 
second metric. Thus the metric packet is inconsistent. I would rather the 
packet had either all old values or all new values.
   
   In promethues, if multiple metrics are related, histogram and summary are 
generally used. These composite types contain multiple thinnest metrics inside.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to