← Back to team overview

graphite-dev team mailing list archive

[Question #255132]: is there a ternary (if-else) function available ?

 

New question #255132 on Graphite:
https://answers.launchpad.net/graphite/+question/255132

I have data containing port.X.uptime and port.X.somecounter. 

uptime resets everytime equipment restarts in other end, while somecounter is an ever growing int

I'm trying to do a graph showing derivate(port.X.somecounter) as series1, and would like a marker at every uptime-reset (series2) on same graph

I can manage that using derivate(port.X.uptime) since its negative numbers, but I would like to scale it into the range 0 to -1 (where 0 means "not restarted" and -1 is "just restarted".

see http://imgur.com/El1OqNw for my atempt

So I was looking for a ternary function (like ?: in perl or C) or a "if(derivate(port.X.uptime)<0,-1,0)" like in excel

Working on the raw data is OK too, like "if(port.X.uptime<0.01,-1,0)".
 
Can that be done in some smart way ? 

/Søren

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