简体   繁体   中英

Weighted average in graphite/statsd

A follow up to this question but I give all the context here.

I am using statsd to report aggregated metrics to graphite:

1/1/2000    metric1    12
2/1/2000    metric1    10

(each value is an average of metric1 in some period)

now when I want to calculate the average over all the period, I need to consider the number of events in each period (eg a period with 10 events will affect the average more than one with three events). So I plan to report the number of events for this metrics separately and do a weighted average.

I expected that many people will need something like this but could not find too much online on this approach. Do I have a wrong requirement in some statistical aspect? Are there better ways to achieve it?

On my system, I collect two metrics, the average and the number of calls (count). Both pieces of data are useful independently. I use the average to diagnose performance issues and the count to find trends in usage. These two together may give what you need. So, if you can, I'd suggest that you start collecting 'count' data too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM