@Override public void execute(MetricTimeSeries timeSeries,FunctionValueMap functionValueMap){
  timeSeries.sort();
  int size=timeSeries.size();
  if (size <= 3) {
    return;
  }
  byte[] usePoint=new byte[size];
  Arrays.fill(usePoint,(byte)1);
  long[] rawTimeStamps=timeSeries.getTimestampsAsArray();
  double[] rawValues=timeSeries.getValuesAsArray();
  timeSeries.clear();
  compute(rawTimeStamps,rawValues,usePoint,tolerance);
  for (int i=0; i < size; i++) {
    if (usePoint[i] == 1) {
      timeSeries.add(rawTimeStamps[i],rawValues[i]);
    }
  }
  functionValueMap.add(this);
}

@ Override public void execute ( MetricTimeSeries timeSeries , FunctionValueMap functionValueMap ) { timeSeries . sort ( ) ; int size = timeSeries . size ( ) ; if ( size <= 3 ) { return ; } byte [ ] usePoint = new byte [ size ] ; Arrays . fill ( usePoint , ( byte ) 1 ) ; long [ ] rawTimeStamps = timeSeries . getTimestampsAsArray ( ) ; double [ ] rawValues = timeSeries . getValuesAsArray ( ) ; timeSeries . clear ( ) ; compute ( rawTimeStamps , rawValues , usePoint , tolerance ) ; for ( int i = 0 ; i < size ; i ++ ) { if ( usePoint [ i ] == 1 ) { timeSeries . add ( rawTimeStamps [ i ] , rawValues [ i ] ) ; } } functionValueMap . add ( this ) ; }
todo : describe the algorithm , a bit . < p > note : the transformation changes the values of the time series ! further analyses such as aggregations uses the transformed values for the calculation .
