Question

In my app I am making frequent calls to an external API. Duration of each call (in seconds) is logged in Graphite.

This part is working fine but I also want to plot the total number of calls. Do I have to gather data in another separately for this or I can get the number of data points from existing data.

Was it helpful?

Solution

Do you submit your data directly to Graphite (carbon) when an API call is made? If that's the case you should be aware that depending on the resolution of your whisper database (e.g. 1 minute or 5 minutes) Graphite only saves the latest data point submitted for a given interval! People therefore use e.g. statsd to let it average all data points for one interval in front of Graphite.

Because of that and the fact, that whisper purges and averages older data using the number of data points will be difficult to get right (or even impossible). You should submit it as a different metric and stay aware of this interval thing.

OTHER TIPS

No. You don't have to. Supposing your timer is- Stats.app.api.call_duration.time_taken

Graphite will automatically calculate a set of things for you. These include count. This will keep the number of times you updated the timer. This is granularity dependent. So Graphite account it and gives you the per-second-count: count_ps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top