← Back to team overview

graphite-dev team mailing list archive

Re: [Question #213347]: Should I use gauges or counters?

 

Question #213347 on Graphite changed:
https://answers.launchpad.net/graphite/+question/213347

    Status: Open => Answered

Daniel Schauenberg proposed the following answer:
Hi,

StatsD generates a total count of counter metrics under the stats_count
namespace. You could just sum those values to get total sign-ups.

Cheers,
Daniel

On Mon, Nov 05, 2012 at 04:45:55PM -0000, Joakim B wrote:
>New question #213347 on Graphite:
>https://answers.launchpad.net/graphite/+question/213347
>
>Whilst being kind of a novice with graphite, I have managed to set it up on a dedicated machine along with statsd and got it working as I want, but this confuses me:
>
>I have a number of places in my application where I would like to keep track of the total amount of things whilst still retaining time-based data. For example - total signups since day 0, as well as signups per minute/hour/whatever.
>
>My first idea was to increment a counter named "users.total" on user signup, but when opening graphite and looking at it I see what I believe is increments per time unit, unless I'm completely misunderstanding it.
>To work around this, I tried to apply different modifiers inside graphite - "sum", "hitcount" and "integral, but neither seems to be able to get a nice total sum over time - Integral is close except that it always has the zero on the left side, making it impossible to zoom in on an area and spot specific changes between dates.
>
>Sure, I could do the equivalent of COUNT("users") in my database and storing it as a gauge datatype, but It would be much nicer to use the already available counter.
>
>What can I do here?
>
>Please bear in mind that I have little milage with Graphite & statsd yet. Thanks in advance!
>
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~graphite-dev
>Post to     : graphite-dev@xxxxxxxxxxxxxxxxxxx
>Unsubscribe : https://launchpad.net/~graphite-dev
>More help   : https://help.launchpad.net/ListHelp

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.