graphite-project/graphite-web — pull request #649 by bluecmd (2014-03-02 01:27:16+00:00)
Title: Add upperBound and lowerBound render target functions.

These functions are the equivalent of min(x, C) and max(x, C).
This allows the user to clip the data to fit other operations.

A real world example would be if you want to see if a switch
interface is up or not, but don't care why it's down.
Since ifOperStatus is >= 2.0 if there is an error:
sum(offset(upperBound(switch.ifOperStatus.*,2.0),-1))