Class StatisticsCollectorImpl
java.lang.Object
com.atlassian.bamboo.build.statistics.StatisticsCollectorImpl
- All Implemented Interfaces:
StatisticsCollector
,SuccessPercentageStatisticsBean
-
Constructor Summary
ConstructorDescriptionStatisticsCollectorImpl
(@Nullable ImmutablePlan plan, @Nullable List<? extends ResultsSummary> results) Class which takes in aCollection
ofResultStatisticsProvider
objects and produces some statistics about it. -
Method Summary
Modifier and TypeMethodDescriptionList of all build numbers in listfloat
Calculates the average number of builds between fixes.long
Returns the averag etime in milliseconds it takes for builds to be fixedint
what is the first build number in this collection?List of build numbers which had failsGet a set of "periods" in which there were failures.int
What is the last number in this collection?@Nullable FailurePeriod
List of build numbers which were successes.double
int
int
int
void
init
(@NotNull List<? extends ResultsSummary> results)
-
Constructor Details
-
StatisticsCollectorImpl
public StatisticsCollectorImpl(@Nullable @Nullable ImmutablePlan plan, @Nullable @Nullable List<? extends ResultsSummary> results) Class which takes in aCollection
ofResultStatisticsProvider
objects and produces some statistics about it.- Parameters:
plan
- - these statistics are forresults
- - to generate statistics from/
-
-
Method Details
-
init
-
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 interfaceStatisticsCollector
- Returns:
List
ofFailurePeriod
-
getSuccessPercentage
public double getSuccessPercentage()- Specified by:
getSuccessPercentage
in interfaceSuccessPercentageStatisticsBean
- Returns:
- percentage of success
-
getTotalNumberOfResults
public int getTotalNumberOfResults()- Specified by:
getTotalNumberOfResults
in interfaceSuccessPercentageStatisticsBean
- Returns:
- total number of results in list.
-
getTotalFailures
public int getTotalFailures()- Specified by:
getTotalFailures
in interfaceSuccessPercentageStatisticsBean
- Returns:
- number of failures.
-
getTotalSuccesses
public int getTotalSuccesses()- Specified by:
getTotalSuccesses
in interfaceSuccessPercentageStatisticsBean
- Returns:
- Number of successes.
-
getAllTestBuildNumbers
List of all build numbers in list- Specified by:
getAllTestBuildNumbers
in interfaceStatisticsCollector
- Returns:
List
ofInteger
representing success. Sorted ASC.
-
getSuccessfulBuildNumbers
List of build numbers which were successes.- Specified by:
getSuccessfulBuildNumbers
in interfaceStatisticsCollector
- Returns:
List
ofInteger
representing success build numbers. Sorted ASC.
-
getFailedBuildNumbers
List of build numbers which had fails- Specified by:
getFailedBuildNumbers
in interfaceStatisticsCollector
- Returns:
List
ofInteger
representing failed build numbers . Sorted ASC.
-
getCreatedInBuild
public int getCreatedInBuild()what is the first build number in this collection?- Specified by:
getCreatedInBuild
in interfaceStatisticsCollector
- Returns:
- first build number;
-
getLastRanInBuild
public int getLastRanInBuild()What is the last number in this collection?- Specified by:
getLastRanInBuild
in interfaceStatisticsCollector
- Returns:
- last build number
-
getLongestElapsedTimePeriod
- Specified by:
getLongestElapsedTimePeriod
in interfaceStatisticsCollector
- Returns:
FailurePeriod
with the longest elapsed time period
-
getLongestElapsedBuildPeriod
- Specified by:
getLongestElapsedBuildPeriod
in interfaceStatisticsCollector
- 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 interfaceStatisticsCollector
- Returns:
- time in milliseconds
-
getAverageElapsedBuilds
public float getAverageElapsedBuilds()Calculates the average number of builds between fixes.- Specified by:
getAverageElapsedBuilds
in interfaceStatisticsCollector
- Returns:
- approximate number of builds elapsed before a fix
-