Class StatisticsCollectorImpl
java.lang.Object
com.atlassian.bamboo.build.statistics.StatisticsCollectorImpl
- All Implemented Interfaces:
StatisticsCollector,SuccessPercentageStatisticsBean
-
Constructor Summary
ConstructorsConstructorDescriptionStatisticsCollectorImpl(@Nullable ImmutablePlan plan, @Nullable List<? extends ResultsSummary> results) Class which takes in aCollectionofResultStatisticsProviderobjects and produces some statistics about it. -
Method Summary
Modifier and TypeMethodDescriptionList of all build numbers in listlongfloatCalculates the average number of builds between fixes.longReturns the averag etime in milliseconds it takes for builds to be fixedintwhat is the first build number in this collection?List of build numbers which had failsGet a set of "periods" in which there were failures.intWhat is the last number in this collection?@Nullable FailurePeriodList of build numbers which were successes.doubleintintintvoidinit(@NotNull List<? extends ResultsSummary> results)
-
Constructor Details
-
StatisticsCollectorImpl
public StatisticsCollectorImpl(@Nullable @Nullable ImmutablePlan plan, @Nullable @Nullable List<? extends ResultsSummary> results) Class which takes in aCollectionofResultStatisticsProviderobjects 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:
getFailurePeriodsin interfaceStatisticsCollector- Returns:
ListofFailurePeriod
-
getSuccessPercentage
public double getSuccessPercentage()- Specified by:
getSuccessPercentagein interfaceSuccessPercentageStatisticsBean- Returns:
- percentage of success
-
getTotalNumberOfResults
public int getTotalNumberOfResults()- Specified by:
getTotalNumberOfResultsin interfaceSuccessPercentageStatisticsBean- Returns:
- total number of results in list.
-
getTotalFailures
public int getTotalFailures()- Specified by:
getTotalFailuresin interfaceSuccessPercentageStatisticsBean- Returns:
- number of failures.
-
getTotalSuccesses
public int getTotalSuccesses()- Specified by:
getTotalSuccessesin interfaceSuccessPercentageStatisticsBean- Returns:
- Number of successes.
-
getAllTestBuildNumbers
List of all build numbers in list- Specified by:
getAllTestBuildNumbersin interfaceStatisticsCollector- Returns:
ListofIntegerrepresenting success. Sorted ASC.
-
getSuccessfulBuildNumbers
List of build numbers which were successes.- Specified by:
getSuccessfulBuildNumbersin interfaceStatisticsCollector- Returns:
ListofIntegerrepresenting success build numbers. Sorted ASC.
-
getFailedBuildNumbers
List of build numbers which had fails- Specified by:
getFailedBuildNumbersin interfaceStatisticsCollector- Returns:
ListofIntegerrepresenting failed build numbers . Sorted ASC.
-
getCreatedInBuild
public int getCreatedInBuild()what is the first build number in this collection?- Specified by:
getCreatedInBuildin interfaceStatisticsCollector- Returns:
- first build number;
-
getLastRanInBuild
public int getLastRanInBuild()What is the last number in this collection?- Specified by:
getLastRanInBuildin interfaceStatisticsCollector- Returns:
- last build number
-
getLongestElapsedTimePeriod
- Specified by:
getLongestElapsedTimePeriodin interfaceStatisticsCollector- Returns:
FailurePeriodwith the longest elapsed time period
-
getLongestElapsedBuildPeriod
- Specified by:
getLongestElapsedBuildPeriodin interfaceStatisticsCollector- Returns:
FailurePeriodwith the longest elapsed builds.
-
getAverageDuration
public long getAverageDuration()- Specified by:
getAverageDurationin interfaceStatisticsCollector- Returns:
- average duration of all successful builds or -1 if there are no successful builds
-
getAverageElapsedTime
public long getAverageElapsedTime()Returns the averag etime in milliseconds it takes for builds to be fixed- Specified by:
getAverageElapsedTimein interfaceStatisticsCollector- Returns:
- time in milliseconds
-
getAverageElapsedBuilds
public float getAverageElapsedBuilds()Calculates the average number of builds between fixes.- Specified by:
getAverageElapsedBuildsin interfaceStatisticsCollector- Returns:
- approximate number of builds elapsed before a fix
-