Class BuildDurationCalculatorDelegate

    • Constructor Detail

      • BuildDurationCalculatorDelegate

        public BuildDurationCalculatorDelegate​(@NotNull
                                               org.springframework.context.ApplicationContext applicationContext)
    • 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 interface BuildDurationCalculator
        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 interface BuildDurationCalculator
        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 interface BuildDurationCalculator
        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 interface BuildDurationCalculator
        Parameters:
        buildTypeId - build type id
        agent - 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 interface BuildDurationCalculator
        Parameters:
        build - target build
        timestamp - pivot to base estimate upon
        Returns:
        estimation for the time left until completion