[concurrency-interest] Concurrent telemetry gathering

Kasper Nielsen kav at it.edu
Thu Nov 16 04:32:14 EST 2006


Gregg Wonderly wrote:
> I'm working on collecting telemetry regarding bandwidth utilization through a 
> "connection".  I've defined the following class, thinking that this should 
> minimize concurrency for updating the numbers.
> 
> In addition, there is a 
> ConcurrentHashMap<OutboundConnection,ConnectionBandwidth> object that is 
> accessed by threads of execution which are handling the I/O requests through the 
> system.  That map is lazily initialized with putIfAbsent().  When the first 
> entry is added, there is a ScheduledThreadPoolExecutor used to schedule a 
> regular execution of "run" to create a time based running average of bandwidth 
> usage.
> 
> Is there anything else I should do differently?

Have you considered using (single) exponential smoothing instead. What 
are you using the numbers for?

- Kasper


More information about the Concurrency-interest mailing list