Interface BuildDurationCalculator

    • Method Detail

      • calculateBuildDuration

        long calculateBuildDuration​(@NotNull
                                    String buildTypeId,
                                    @NotNull
                                    BuildAgent agent)
        Calculates estimated duration of a build of the specified build type on the specified agent.
        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

        long calculateAgentBuildDuration​(@NotNull
                                         String buildTypeId,
                                         @NotNull
                                         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.
        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

        long calculateBuildDuration​(@NotNull
                                    String buildTypeId)
        Calculates estimated duration of a build of the specified build type.
        Parameters:
        buildTypeId -
        Returns:
        Estimated time in milliseconds. -1 if an estimate cannot be calculated for some reason (e.g. lack of historical data).
      • hasDataForAgent

        boolean hasDataForAgent​(@NotNull
                                String buildTypeId,
                                @NotNull
                                BuildAgent agent)
        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

        long estimateTimeLeftFor​(@NotNull
                                 RunningBuildEx build,
                                 long timestamp)
        Estimates time for the given build to complete from the given (timestamp) pivot
        Parameters:
        build - target build
        timestamp - pivot to base estimate upon
        Returns:
        estimation for the time left until completion