28.3. Build

28.3.1. Description

Buid reduction function computes a single telemetry stream representing build information. It can show the invocations of the build tool (for example, Ant), the time spent building, the target invoked, and whether the results were successful or not.

28.3.2. Parameter

Table 28.2. 

ParameterDescriptionDefault
modeOne of 'BuildCount', 'SuccessCount', 'BuildTime', or 'SuccessTime'. Time is in unit of hours.BuildCount
isCumulativeIf true, an cumulative version of telemetry stream is returned.false
memberEmailDetermines whoes build data should be included in computation. Either a single project member email, or '*' to indicate all members.*
configurationEither a string naming a build configuration, or '*' to indicate all configurations.*
startTypeEither a string naming a build start type, or '*' to indicate all types.*

28.3.3. Example 1

Example 28.2. Build

streams BuildStream(countOrTime, cumulative) = {
   "Build", Build(countOrTime, cumulative)
};

y-axis yAxis(label) = {label};

chart BuildChart() = {
  "Build Count", 
  (BuildStream("BuildCount", "false"), yAxis("Build Count"))
};

draw BuildChart();

The chart shows that the total number of build invocations by all project members.

28.3.4. Example 2

Example 28.3. Build Successes and Failures (single axis)

streams BuildSuccessStream(cumulative) = {
   "Build Successes", Build("SuccessCount", cumulative)
};

streams BuildFailureStream(cumulative) = {
  "Build Failures", Build("BuildCount", cumulative) - Build("SuccessCount", cumulative)
};

y-axis yAxis(label) = {label};

chart BuildChart(cumulative) = {
  "Build Successes And Failures",
  (BuildSuccessStream(cumulative), yAxis("Build Count")), 
  (BuildFailureStream(cumulative), yAxis("Build Count"))
};

draw BuildChart("false");

This chart shows the nubmer of successful build invocations vs. the nubmer of failed build invocations.

28.3.5. Note

Pay special attention to the last two parameters of the Build reduction function: 'configuration' and 'startType'. They are optional information in 'Build' sdt. In other words, not all build sensor data contain such information. Currently, only the build data sent by Ant sensor contain these information. The safest way is to use wildcard '*'.