@Override public void execute(MetricTimeSeries timeSeries,FunctionValueMap functionValueMap){
  if (timeSeries.size() <= 0) {
    functionValueMap.add(this,Double.NaN);
    return;
  }
  timeSeries.sort();
  double firstValue=timeSeries.getValue(0);
  double lastValue=timeSeries.getValue(timeSeries.size() - 1);
  functionValueMap.add(this,Math.abs(firstValue - lastValue));
}

@ Override public void execute ( MetricTimeSeries timeSeries , FunctionValueMap functionValueMap ) { if ( timeSeries . size ( ) <= 0 ) { functionValueMap . add ( this , Double . NaN ) ; return ; } timeSeries . sort ( ) ; double firstValue = timeSeries . getValue ( 0 ) ; double lastValue = timeSeries . getValue ( timeSeries . size ( ) - 1 ) ; functionValueMap . add ( this , Math . abs ( firstValue - lastValue ) ) ; }
calculate the difference between the first and the last value of a given time series
