Class StatisticsCollectorImpl
- java.lang.Object
-
- com.atlassian.bamboo.build.statistics.StatisticsCollectorImpl
-
- All Implemented Interfaces:
StatisticsCollector
,SuccessPercentageStatisticsBean
public class StatisticsCollectorImpl extends Object implements StatisticsCollector
-
-
Constructor Summary
Constructors Constructor Description StatisticsCollectorImpl(@Nullable ImmutablePlan plan, @Nullable List<? extends ResultsSummary> results)
Class which takes in aCollection
ofResultStatisticsProvider
objects and produces some statistics about it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>
getAllTestBuildNumbers()
List of all build numbers in listfloat
getAverageElapsedBuilds()
Calculates the average number of builds between fixes.long
getAverageElapsedTime()
Returns the averag etime in milliseconds it takes for builds to be fixedint
getCreatedInBuild()
what is the first build number in this collection?List<Integer>
getFailedBuildNumbers()
List of build numbers which had failsList<FailurePeriod>
getFailurePeriods()
Get a set of "periods" in which there were failures.int
getLastRanInBuild()
What is the last number in this collection?FailurePeriod
getLongestElapsedBuildPeriod()
@Nullable FailurePeriod
getLongestElapsedTimePeriod()
List<Integer>
getSuccessfulBuildNumbers()
List of build numbers which were successes.double
getSuccessPercentage()
int
getTotalFailures()
int
getTotalNumberOfResults()
int
getTotalSuccesses()
void
init(@NotNull List<? extends ResultsSummary> results)
-
-
-
Constructor Detail
-
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 Detail
-
init
public void init(@NotNull @NotNull List<? extends ResultsSummary> results)
-
getFailurePeriods
public 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 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
public List<Integer> getAllTestBuildNumbers()
List of all build numbers in list- Specified by:
getAllTestBuildNumbers
in interfaceStatisticsCollector
- Returns:
List
ofInteger
representing success. Sorted ASC.
-
getSuccessfulBuildNumbers
public List<Integer> getSuccessfulBuildNumbers()
List of build numbers which were successes.- Specified by:
getSuccessfulBuildNumbers
in interfaceStatisticsCollector
- Returns:
List
ofInteger
representing success build numbers. Sorted ASC.
-
getFailedBuildNumbers
public List<Integer> 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
@Nullable public @Nullable FailurePeriod getLongestElapsedTimePeriod()
- Specified by:
getLongestElapsedTimePeriod
in interfaceStatisticsCollector
- Returns:
FailurePeriod
with the longest elapsed time period
-
getLongestElapsedBuildPeriod
public FailurePeriod 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
-
-