Hi Dave,

This is done through a meta point.

Something like....

```
var changeThreshhold = 5 //5 units per minute, let's say
var data = p.past(MINUTE, 5)
if( data.count == 0 ) {
//Handle no data in period condition, raise event?
return true;
} else if ( data.count == 1 ) {
//Handle only one piece of data in our range by getting another value
var lv = p.lastValue(1);
if ( lv == null ) //Only one data point, no cause for alarm. We may not need to check this
return false
return changeThreshhold > ( data.lastValue - lv.value )/((data.lastTime - lv.time)/60000);
} else {
return changeThreshhold > ( data.lastValue - data.firstValue )/((data.lastTime - data.firstTime)/60000);
}
```

Then having a state detector on the meta point checking for a "true" state. This isn't its own detector because the shrewd observer may see data sets where this logic is deeply flawed (specifically, data that isn't monotonic). For situations where your data varies in both directions, you may be more interested in changing the logic to sum the differences as you iterate the list, and alarm if you cross the threshhold, more like....

```
var data = p.pointValuesSince(new Date().getTime() - 5*60*1000) //Five minutes in milliseconds
if( data.length <= 1 ) //we have the same edge conditions for our range
return false
var sum = 0;
var changeThreshhold = 5; //so, this would mean that if any point in the period it is more than
for( var k = 0; k < data.length-1; k+=1 ) {
sum += (data[k+1].value - data[k].value);
if( sum < changeThreshhold || sum > changeThreshhold )
return true;
}
return false;
```

So, what it means to have changed over time can be funky depending on your data set. That second version should be equivalent to seeing if any values in a range are outside the acceptable rate of change... like,

```
var data = p.pointValuesSince(new Date().getTime() - 5*60*1000) //Five minutes in milliseconds
if( data.length <= 1 ) //we have the same edge conditions for our range
return false
var firstValue = data[0];
var changeThreshhold = 5; //so, this would mean that if any point in the period it is more than
for( var k = 1; k < data.length; k+=1 ) {
if( firstValue.value - data[k].value > changeThreshhold || firstValue.value - data[k].value < changeThreshhold )
return true;
}
return false;
```

But this could still be flawed. If data[0].value == 0, data[1].value == -3, and data[2].value == 3, then none of these detectors would alarm, even though we experienced a change of 6 at one point. One would expect the next run of the point will have data[0] == -3, but having uniform data in time is an assumption we shouldn't rest our logic on!