org.hackystat.telemetry.analyzer.reducer.impl
Class UnitTestReducer

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.reducer.impl.UnitTestReducer
All Implemented Interfaces:
TelemetryReducer

public class UnitTestReducer
extends java.lang.Object
implements TelemetryReducer

Returns a single stream providing UnitTest data.

Options:

  1. mode: One of 'TotalCount', 'SuccessCount', or 'FailureCount'. Default is 'TotalCount'.
  2. member: The project member whose unit test data is to be returned, or "*" for all members.
  3. isCumulative: True or false. Default is false.

Author:
Hongbing Kou, Philip Johnson

Nested Class Summary
static class UnitTestReducer.Mode
          Possible mode values.
 
Constructor Summary
UnitTestReducer()
           
 
Method Summary
 TelemetryStreamCollection compute(org.hackystat.sensorbase.resource.projects.jaxb.Project project, org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient, org.hackystat.utilities.time.interval.Interval interval, java.lang.String[] options)
          Computes and returns the required telemetry streams object.
(package private)  java.lang.Long getData(org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient, org.hackystat.sensorbase.resource.projects.jaxb.Project project, org.hackystat.utilities.time.period.Day startDay, org.hackystat.utilities.time.period.Day endDay, UnitTestReducer.Mode mode, java.lang.String member)
          Returns a UnitTest value for the specified time interval, or null if no SensorData.
(package private)  TelemetryStream getStream(org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient, org.hackystat.sensorbase.resource.projects.jaxb.Project project, org.hackystat.utilities.time.interval.Interval interval, UnitTestReducer.Mode mode, java.lang.String member, boolean isCumulative, java.lang.Object streamTagValue)
          Gets the telemetry stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitTestReducer

public UnitTestReducer()
Method Detail

compute

public TelemetryStreamCollection compute(org.hackystat.sensorbase.resource.projects.jaxb.Project project,
                                         org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient,
                                         org.hackystat.utilities.time.interval.Interval interval,
                                         java.lang.String[] options)
                                  throws TelemetryReducerException
Computes and returns the required telemetry streams object.

Specified by:
compute in interface TelemetryReducer
Parameters:
project - The project.
dpdClient - The DPD Client.
interval - The interval.
options - The optional parameters.
Returns:
Telemetry stream collection.
Throws:
TelemetryReducerException - If there is any error.

getStream

TelemetryStream getStream(org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient,
                          org.hackystat.sensorbase.resource.projects.jaxb.Project project,
                          org.hackystat.utilities.time.interval.Interval interval,
                          UnitTestReducer.Mode mode,
                          java.lang.String member,
                          boolean isCumulative,
                          java.lang.Object streamTagValue)
                    throws java.lang.Exception
Gets the telemetry stream.

Parameters:
dpdClient - The DailyProjectData client we will contact for the data.
project - The project.
interval - The interval.
mode - The mode (TOTALCOUNT, SUCCESSCOUNT, or FAILURECOUNT).
member - The member, or "*" for all members.
isCumulative - True for cumulative measure.
streamTagValue - The tag for the generated telemetry stream.
Returns:
The telemetry stream as required.
Throws:
java.lang.Exception - If there is any error.

getData

java.lang.Long getData(org.hackystat.dailyprojectdata.client.DailyProjectDataClient dpdClient,
                       org.hackystat.sensorbase.resource.projects.jaxb.Project project,
                       org.hackystat.utilities.time.period.Day startDay,
                       org.hackystat.utilities.time.period.Day endDay,
                       UnitTestReducer.Mode mode,
                       java.lang.String member)
                 throws TelemetryReducerException
Returns a UnitTest value for the specified time interval, or null if no SensorData.

Parameters:
dpdClient - The DailyProjectData client we will use to get this data.
project - The project.
startDay - The start day (inclusive).
endDay - The end day (inclusive).
mode - The mode.
member - The member email, or "*" for all members.
Returns:
The UnitTest count, or null if there is no UnitTest SensorData for that time period.
Throws:
TelemetryReducerException - If anything goes wrong.