com.atlassian.bamboo.build.statistics
Class StatisticsCollectorImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.statistics.StatisticsCollectorImpl
All Implemented Interfaces:
StatisticsCollector, SuccessPercentageStatisticsBean

public class StatisticsCollectorImpl
extends java.lang.Object
implements StatisticsCollector


Constructor Summary
StatisticsCollectorImpl(Plan plan, java.util.List<? extends ResultsSummary> results)
          Class which takes in a Collection of ResultStatisticsProvider objects and produces some statistics about it.
 
Method Summary
 java.util.List<java.lang.Integer> getAllTestBuildNumbers()
          List of all build numbers in list
 float getAverageElapsedBuilds()
          Calculates the average number of builds between fixes.
 long getAverageElapsedTime()
          Returns the averag etime in milliseconds it takes for builds to be fixed
 int getCreatedInBuild()
          what is the first build number in this collection?
 java.util.List<java.lang.Integer> getFailedBuildNumbers()
          List of build numbers which had fails
 java.util.List<FailurePeriod> getFailurePeriods()
          Get a set of "periods" in which there were failures.
 int getLastRanInBuild()
          What is the last number in this collection?
 FailurePeriod getLongestElapsedBuildPeriod()
           
 FailurePeriod getLongestElapsedTimePeriod()
           
 java.util.List<java.lang.Integer> getSuccessfulBuildNumbers()
          List of build numbers which were successes.
 double getSuccessPercentage()
           
 int getTotalFailures()
           
 int getTotalNumberOfResults()
           
 int getTotalSuccesses()
           
 void init(java.util.List<? extends ResultsSummary> results)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsCollectorImpl

public StatisticsCollectorImpl(@Nullable
                               Plan plan,
                               @Nullable
                               java.util.List<? extends ResultsSummary> results)
Class which takes in a Collection of ResultStatisticsProvider objects and produces some statistics about it.

Parameters:
plan - - these statistics are for
results - - to generate statistics from/
Method Detail

init

public void init(@NotNull
                 java.util.List<? extends ResultsSummary> results)

getFailurePeriods

public java.util.List<FailurePeriod> getFailurePeriods()
Get a set of "periods" in which there were failures. A failure "period" is one in which there are continuous failures by build number.

Specified by:
getFailurePeriods in interface StatisticsCollector
Returns:
List of FailurePeriod

getSuccessPercentage

public double getSuccessPercentage()
Specified by:
getSuccessPercentage in interface SuccessPercentageStatisticsBean
Returns:
percentage of success

getTotalNumberOfResults

public int getTotalNumberOfResults()
Specified by:
getTotalNumberOfResults in interface SuccessPercentageStatisticsBean
Returns:
total number of results in list.

getTotalFailures

public int getTotalFailures()
Specified by:
getTotalFailures in interface SuccessPercentageStatisticsBean
Returns:
number of failures.

getTotalSuccesses

public int getTotalSuccesses()
Specified by:
getTotalSuccesses in interface SuccessPercentageStatisticsBean
Returns:
Number of successes.

getAllTestBuildNumbers

public java.util.List<java.lang.Integer> getAllTestBuildNumbers()
List of all build numbers in list

Specified by:
getAllTestBuildNumbers in interface StatisticsCollector
Returns:
List of Integer representing success. Sorted ASC.

getSuccessfulBuildNumbers

public java.util.List<java.lang.Integer> getSuccessfulBuildNumbers()
List of build numbers which were successes.

Specified by:
getSuccessfulBuildNumbers in interface StatisticsCollector
Returns:
List of Integer representing success build numbers. Sorted ASC.

getFailedBuildNumbers

public java.util.List<java.lang.Integer> getFailedBuildNumbers()
List of build numbers which had fails

Specified by:
getFailedBuildNumbers in interface StatisticsCollector
Returns:
List of Integer representing failed build numbers . Sorted ASC.

getCreatedInBuild

public int getCreatedInBuild()
what is the first build number in this collection?

Specified by:
getCreatedInBuild in interface StatisticsCollector
Returns:
first build number;

getLastRanInBuild

public int getLastRanInBuild()
What is the last number in this collection?

Specified by:
getLastRanInBuild in interface StatisticsCollector
Returns:
last build number

getLongestElapsedTimePeriod

@Nullable
public FailurePeriod getLongestElapsedTimePeriod()
Specified by:
getLongestElapsedTimePeriod in interface StatisticsCollector
Returns:
FailurePeriod with the longest elapsed time period

getLongestElapsedBuildPeriod

public FailurePeriod getLongestElapsedBuildPeriod()
Specified by:
getLongestElapsedBuildPeriod in interface StatisticsCollector
Returns:
FailurePeriod with the longest elapsed builds.

getAverageElapsedTime

public long getAverageElapsedTime()
Returns the averag etime in milliseconds it takes for builds to be fixed

Specified by:
getAverageElapsedTime in interface StatisticsCollector
Returns:
time in milliseconds

getAverageElapsedBuilds

public float getAverageElapsedBuilds()
Calculates the average number of builds between fixes.

Specified by:
getAverageElapsedBuilds in interface StatisticsCollector
Returns:
approximate number of builds elapsed before a fix


Copyright © 2011 Atlassian. All Rights Reserved.