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

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

public class BuildReducer
extends java.lang.Object
implements TelemetryReducer

Returns a single stream providing Build data.

Accepts the following options in the following order.

  1. User: Supply a user email to get Build counts for just that user. Default is "*" indicating the aggregate Build Data for all project members.
  2. Result: One of Success, Failure, or *, indicating whether the count is just of successful builds, failed builds, or all builds. Default is "*".
  3. Type: A string to restrict the counts to those builds with a "Type" property matching this string, or "*" to indicate all builds regardless of Type. Default is "*".
  4. isCumulative: True or false. Default is false.

Author:
Philip Johnson

Constructor Summary
BuildReducer()
           
 
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, java.lang.String member, java.lang.String result, java.lang.String type)
          Returns a Build count 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, java.lang.String member, java.lang.String result, java.lang.String type, 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

BuildReducer

public BuildReducer()
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,
                          java.lang.String member,
                          java.lang.String result,
                          java.lang.String type,
                          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.
member - Project member, or null to match all members.
result - The build result, either FAILURE, SUCCESS, or null to match both.
type - The value of the build 'Type' property, a string or null to match anything.
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,
                       java.lang.String member,
                       java.lang.String result,
                       java.lang.String type)
                 throws TelemetryReducerException
Returns a Build count 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).
member - The project member email, or null to match all members.
result - The result, either SUCCESS, FAILURE, or null for both.
type - The 'Type' property, or null to match anything.
Returns:
The Build count, or null if there is no Build SensorData for that time period.
Throws:
TelemetryReducerException - If anything goes wrong.