graphite-project / carbon

Carbon is one of the components of Graphite, and is responsible for receiving metrics over the network and writing them down to disk using a storage backend.
http://graphite.readthedocs.org/
Apache License 2.0
1.5k stars 490 forks source link

[Q] Can not figure out how to get reduceSeries to work with nonNegativeDerivative results #892

Closed rldleblanc closed 4 years ago

rldleblanc commented 4 years ago

I need to take some gauge data and convert it to rates, then divide some of these series, but I can't figure out how to make it work, and my attempts to use the API to step through the data starts failing at mapSeries. Here is what I think the query should be:

reduceSeries(mapSeries(aliasByNode(nonNegativeDerivative(servers.mds.CephCollector.ceph.mds.*.mds_server.\_latency.{avgcount,sum}), 1, 7, 8), 0, 1), "divideSeries", 2, "sum", "avgcount")

I tried with and without aliasByNode and we are using graphite 1.0.2.

Based on a previous reduceSeries/mapSeries query I did previously, I think I understand how it supposed to work, but I could be missing something still as that one was a little more straight forward.

I can't push the nonNegativeDerivative function outside of the reduceSeries because it would return the wrong data as an example:

{ "avgcount": 16412, "sum": 8126.114621873, "avgtime": 0.495132501 } { "avgcount": 16646, "sum": 8147.610450831, "avgtime": 0.489463561 } (sum2-sum1)/(avgcount2-avgcount1) = 0.092 (correct) (sum2/avgcount2)-(sum1/avgcount1) = -0.005 (incorrect)

avgcount is operations and sum is time, the object is to get the amount of time per operation for the last batch of operations.

Thank you!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.