How do I count events?¶
Librato supports distributed counting, meaning you can send us multiple measurements of 1 (or more) from wherever a count is incremented (even the same process), and we’ll aggregate them up to a per-interval count in the gauge at the end of the period.
To enable this behavior, have each agent submit a gauge measurement with the same name and source and then turn on service-side aggregation (SSA) for the metric.
Set the aggregation function for the metric to “sum” and you will get the sum of the count of the events.
How do I cumulatively count events?¶
A cumulatiave count / cumulative sum is useful for metrics that you want to see change over a long period to time. This can be useful for tracking the total amount of actions ever happened in your application. e.g. Total Users Signed up, Vists to a webpage, Total Twitter Mentions.
To view a metric as a cumulative count you’ll need to create a composite metric using the integrate function.
integrate(sum(s("twitter.mentions", "*", { period:"60", function:"sum" })))