Class BuildDurationCalculatorDelegate
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.timeEstimation.BuildDurationCalculatorDelegate
-
- All Implemented Interfaces:
BuildDurationCalculator
public class BuildDurationCalculatorDelegate extends Object implements BuildDurationCalculator
Created by Andrey Titov on 11.03.16.
-
-
Constructor Summary
Constructors Constructor Description BuildDurationCalculatorDelegate(org.springframework.context.ApplicationContext applicationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcalculateAgentBuildDuration(String buildTypeId, BuildAgent agent)Calculates estimated duration of a build of the specified build type on the specified agent considering only the time build spent on agent.longcalculateBuildDuration(String buildTypeId)Calculates estimated duration of a build of the specified build type.longcalculateBuildDuration(String buildTypeId, BuildAgent agent)Calculates estimated duration of a build of the specified build type on the specified agent.longestimateTimeLeftFor(RunningBuildEx build, long timestamp)Estimates time for the given build to complete from the given (timestamp) pivotbooleanhasDataForAgent(String buildTypeId, BuildAgent agent)
-
-
-
Method Detail
-
calculateBuildDuration
public long calculateBuildDuration(@NotNull String buildTypeId, @NotNull BuildAgent agent)Description copied from interface:BuildDurationCalculatorCalculates estimated duration of a build of the specified build type on the specified agent.- Specified by:
calculateBuildDurationin interfaceBuildDurationCalculator- Parameters:
buildTypeId- build type id.agent- build agent.- Returns:
- Estimated time in milliseconds. -1 if an estimate cannot be calculated for some reason (e.g. lack of historical data).
-
calculateAgentBuildDuration
public long calculateAgentBuildDuration(@NotNull String buildTypeId, @NotNull BuildAgent agent)Description copied from interface:BuildDurationCalculatorCalculates estimated duration of a build of the specified build type on the specified agent considering only the time build spent on agent.- Specified by:
calculateAgentBuildDurationin interfaceBuildDurationCalculator- Parameters:
buildTypeId- build type id.agent- build agent.- Returns:
- Estimated time in milliseconds. -1 if an estimate cannot be calculated for some reason (e.g. lack of historical data).
-
calculateBuildDuration
public long calculateBuildDuration(@NotNull String buildTypeId)Description copied from interface:BuildDurationCalculatorCalculates estimated duration of a build of the specified build type.- Specified by:
calculateBuildDurationin interfaceBuildDurationCalculator- Returns:
- Estimated time in milliseconds. -1 if an estimate cannot be calculated for some reason (e.g. lack of historical data).
-
hasDataForAgent
public boolean hasDataForAgent(@NotNull String buildTypeId, @NotNull BuildAgent agent)- Specified by:
hasDataForAgentin interfaceBuildDurationCalculator- Parameters:
buildTypeId- build type idagent- agent- Returns:
- true if calculator has data for specified build configuration and agent (i.e. build of specified build configuration has been executed on the specified agent).
-
estimateTimeLeftFor
public long estimateTimeLeftFor(@NotNull RunningBuildEx build, long timestamp)Description copied from interface:BuildDurationCalculatorEstimates time for the given build to complete from the given (timestamp) pivot- Specified by:
estimateTimeLeftForin interfaceBuildDurationCalculator- Parameters:
build- target buildtimestamp- pivot to base estimate upon- Returns:
- estimation for the time left until completion
-
-