org.hackystat.telemetry.analyzer.function.impl
Class FilterFunction

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.function.TelemetryFunction
      extended by org.hackystat.telemetry.analyzer.function.impl.FilterFunction

public class FilterFunction
extends TelemetryFunction

Filters telemetry streams in a TelemetryStreamCollection object by applying a ranking function.

Author:
(Cedric) Qin ZHANG

Nested Class Summary
(package private) static class FilterFunction.AverageRankFunction
          A rank function using average as ranking criteria.
(package private) static class FilterFunction.DeltaRankFunction
          A rank function using delta as ranking criteria.
(package private) static class FilterFunction.LastRankFunction
          A rank function using the lastest data point value as ranking criteria.
(package private) static class FilterFunction.MaxRankFunction
          A rank function using max as ranking criteria.
(package private) static class FilterFunction.MinRankFunction
          A rank function using min as ranking criteria.
(package private) static interface FilterFunction.RankFunction
          Rank function.
(package private) static class FilterFunction.SimpleDeltaRankFunction
          A rank function using the different between the last data point and the first data point as criteria.
 
Constructor Summary
FilterFunction()
          Constructs this instance.
 
Method Summary
 java.lang.Object compute(java.lang.Object[] parameters)
          Performs filter operation.
 
Methods inherited from class org.hackystat.telemetry.analyzer.function.TelemetryFunction
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterFunction

public FilterFunction()
Constructs this instance.

Method Detail

compute

public java.lang.Object compute(java.lang.Object[] parameters)
                         throws TelemetryFunctionException
Performs filter operation. The returned TelemetryStreamCollection only contains telemetry streams that satisfies the specified criteria.

Specified by:
compute in class TelemetryFunction
Parameters:
parameters - An array of 3 objects.
  • 1st element: A TelemetryStreamCollection instance.
  • 2nd element: A String representing ranking function name. It must be one of "Sum|Max|Min|Last|Delta".
  • 3rd element: A String specifying how to apply cutoff value. It must be one of "Above|Below|Top|Bottom|TopPercent|BottomPercent".
  • 4th element: A Number instance representing cutoff value.
Returns:
A new TelemetryStreamCollection instance after filtering. Note that it may contain no telemetry stream at all if no stream satisfies the criteria.
Throws:
TelemetryFunctionException - If anything is wrong.