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 long
calculateAgentBuildDuration(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.long
calculateBuildDuration(String buildTypeId)
Calculates estimated duration of a build of the specified build type.long
calculateBuildDuration(String buildTypeId, BuildAgent agent)
Calculates estimated duration of a build of the specified build type on the specified agent.long
estimateTimeLeftFor(RunningBuildEx build, long timestamp)
Estimates time for the given build to complete from the given (timestamp) pivotboolean
hasDataForAgent(String buildTypeId, BuildAgent agent)
-
-
-
Method Detail
-
calculateBuildDuration
public long calculateBuildDuration(@NotNull String buildTypeId, @NotNull BuildAgent agent)
Description copied from interface:BuildDurationCalculator
Calculates estimated duration of a build of the specified build type on the specified agent.- Specified by:
calculateBuildDuration
in 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:BuildDurationCalculator
Calculates estimated duration of a build of the specified build type on the specified agent considering only the time build spent on agent.- Specified by:
calculateAgentBuildDuration
in 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:BuildDurationCalculator
Calculates estimated duration of a build of the specified build type.- Specified by:
calculateBuildDuration
in 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:
hasDataForAgent
in 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:BuildDurationCalculator
Estimates time for the given build to complete from the given (timestamp) pivot- Specified by:
estimateTimeLeftFor
in interfaceBuildDurationCalculator
- Parameters:
build
- target buildtimestamp
- pivot to base estimate upon- Returns:
- estimation for the time left until completion
-
-