← Back to team overview

graphite-dev team mailing list archive

Re: [Question #173304]: integral-functions for the long period are incorrect

 

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

    Status: Open => Answered

chrismd proposed the following answer:
I think the problem is that your older data in lower precision archives
is averaged when you probably want it summed. If you are on a recent
trunk checkout or 0.9.9 you can configure the aggregation method whisper
uses to rollup datapoints into lower precision archives. To do this you
can GET the url http://graphite/metrics/set-
metadata?metric=foo.bar.baz&key=aggregationMethod&value=sum

You can verify it with:

http://graphite/metrics/get-
metadata?metric=foo.bar.baz&key=aggregationMethod

Note that this will only affect future aggregations, it cannot recompute
the current aggregate values. You can also change it en masse by POSTing
application/json data like this to the set-metadata url:

{
  "operations": [
    {"metric": "foo.bar.baz", "key": "aggregationMethod", "value": "sum"},
    {"metric": "foo.bar.baz2", "key": "aggregationMethod", "value": "sum"},
    ...
  ]
}

In order to make sure metrics created in the future have the proper
aggregationMethod, create a /opt/graphite/conf/storage-aggregation.conf
file. It works the exact same way storage-schemas.conf does except
instead of specifying 'retentions' for a set of metrics, you define
'aggregationmethod' and/or 'xfilesfactor'. For example:

[latency-metrics]
pattern = .*responseTime
aggregationmethod = average

[everything-else]
match-all = true
aggregationmethod = sum

Again this only works with 0.9.9 or recent trunk. I hope that helps.

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