constants


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
)
)

Related Links

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?

Categories

HOME
arrays
spring
plsql
shopify
freepascal
windows-7
mapbox-gl-js
vsftpd
internet-explorer-11
dropbear
eclipse-cdt
outlook-web-addins
android-source
wordpress-theming
future
pdo
lenskit
opera-mini
aspell
phpbb
anychart
cython
rails-activerecord
avplayeritem
piwik
printdocument
hanami
osmdroid
google-api-dotnet-client
encase
ioc-container
exponential
hotmail
ifstream
rhino
pox
mmdrawercontroller
bigcartel
office365connectors
android-download-manager
haskell-pipes
stdclass
android-maps-v2
g1gc
homekit
lftp
apiary
ajp
double-buffering
timesten
pinvoke
mouseclick-event
dwarf
greenhills
volume
search-box
lotus
laravel-query-builder
windows-azure-pack
uistackview
picasa
chessboard.js
slam-algorithm
spoofing
amf
datainputstream
android-viewholder
rad
fabric-twitter
python-winshell
apigee-baas
wif
connection-reset
graphical-logo
criteria-api
rspec3
musl
errorprovider
collabnet
ogr2ogr
mov
author
bullet
wss
mbox
bounds
logentries
ng-hide
javascriptmvc
dynamic-binding
vmware-server
shortcuts
client-library
fluidsynth
marmalade-edk
pstree
hibernate3
responsetext
entity-framework-ctp5
mysql-error-1045
zookeeper
opengl-es-lighting
delegatecommand
aio
chdatastructures
openwysiwyg
web-analytics-tools

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App