Class WeightedAverageBuildDurationCalculator

    • Method Detail

      • getWellKnownStages

        @NotNull
        public static Collection<String> getWellKnownStages()
      • setIgnoreTooShortBuilds

        public void setIgnoreTooShortBuilds​(boolean ignore)
      • shouldSkip

        protected boolean shouldSkip​(@NotNull
                                     String buildTypeId,
                                     String agentName,
                                     long totalBuildDuration)
      • 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).
      • 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).
      • 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).
      • 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).
      • setBuildHistory

        public void setBuildHistory​(@NotNull
                                    BuildHistory history)
      • calculateBuildDuration

        protected long calculateBuildDuration​(@NotNull
                                              String buildTypeId,
                                              @Nullable
                                              String agentName,
                                              String... stagesToUse)
      • 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
      • shouldUseTotal

        public static boolean shouldUseTotal​(@NotNull
                                             String buildTypeId)