In Graphite, how to cap data to a constant when data is above that constant?
I thought that my request would be pretty common but I haven't been able to find a solution for it. The subject/summary says it all, but to give more color, I have a metric that is typically between 0 and 100 but in some weird cases it shoots up to a few 1000s which dwarfs the rest of the 0-100 data. My goal is that when the data is beyond 100 set it as say 110 so that I know it's a value is beyond 100. The only thing I could find is removeAboveValue() but when used it looks as if the data is missing. Please help. Thanks!
The simplest way is to use transformNulls so query would look like: transfromNull(removeAboveValue(some.metric.avg, 100), 110) Note that above will also set 110 to the real gaps. Of course you could use again transformNull in the origin metric to mark gaps as ... -1 (or whatever) transfromNull(removeAboveValue(transfromNull(some.metric.avg, -1), 100), 110) But this introduces magic null has value, besides it's bad (misleading) it's not always possible (if metric can have negative values, zero or whatever). Next solution is ... prepare line with only exceeding datapoints and set theirs value to 110. It may be done in many ways. Let's take some simple approach: a. get only point above 100 removeBelowValue(some.metric.avg, 100) b. reduce its value to 1 using division by the same metric: divideSeries(removeBelowValue(some.metric.avg, 100), removeBelowValue(some.metric.avg, 100)) c. set value to 110 - multiple by 110: scale(divideSeries(removeBelowValue(some.metric.avg, 100), removeBelowValue(some.metric.avg, 100)),110) merge the prepared metric with the one with values below threshold (using removeAboveValue). As merge function, in this case, use minSeries minSeries( removeAboveValue(some.metric.avg, 100), scale( divideSeries( removeBelowValue(some.metric.avg, 100), removeBelowValue(some.metric.avg, 100) ), 110 ) )
Why do we put integer values in Constant class in Java/Android?
What is the difference between “const” and “val”?
Global constants in Dragon NaturallySpeaking's advanced scripting
What are the “hidden constants”?
Are there a constants in scapy for TCP and UDP?
Where can I find a list of constants for Request Transaction Types for Authorize.Net's API?
When we will consider the constants in asymptotic notations?
Why does Pybrain predict always the same value ?
How can I set a constant in autoconf checking for a program?
Error: <signal> is not a constant
What is the write constant [duplicate]
can a constant pointer be changed during for iterations?
What is the value of ABAP constants with prefix “%_”?
introducing constants in solve function
private type declaration is throwing error?
What is the syntax for declaring a constant string[char] AA?