Interface StatisticPriorityScheduler

    • Method Detail

      • getExecutionDelaySamples

        java.util.List<java.lang.Long> getExecutionDelaySamples()
        Get raw sample data for task execution delays. This raw data can be used for more advanced statistics which are not provided in this library. These can also be fed into utilities in StatisticsUtils for additional statistics.

        The returned result set includes all priorities. If you want durations for a specific priority use getExecutionDelaySamples(TaskPriority).

        Specified by:
        getExecutionDelaySamples in interface StatisticExecutor
        Returns:
        A list of delay times in milliseconds before a task was executed
      • getExecutionDelaySamples

        java.util.List<java.lang.Long> getExecutionDelaySamples​(TaskPriority priority)
        Call to get a list of all currently recorded times for execution delays. This is the window used for the rolling average for getAverageExecutionDelay(TaskPriority). This call allows for more complex statistics (ie looking for outliers, etc).
        Parameters:
        priority - Task priority to provide samples for
        Returns:
        list which represents execution delay samples
      • getAverageExecutionDelay

        double getAverageExecutionDelay()
        This reports the rolling average delay from when a task was expected to run, till when the executor actually started the task. This will return -1 if no samples have been collected yet. This call averages over all priority types, if you want the delay for a specific priority use getAverageExecutionDelay(TaskPriority).
        Specified by:
        getAverageExecutionDelay in interface StatisticExecutor
        Returns:
        Average delay for tasks to be executed in milliseconds
      • getAverageExecutionDelay

        double getAverageExecutionDelay​(TaskPriority priority)
        Gets the average delay from when the task is ready, to when it is actually executed. This will only inspect the times for a specific priority.
        Parameters:
        priority - Specific task priority which statistics should be calculated against
        Returns:
        Average delay for tasks to be executed in milliseconds
      • getExecutionDelayPercentiles

        java.util.Map<java.lang.Double,​java.lang.Long> getExecutionDelayPercentiles​(double... percentiles)
        Gets percentile values for execution delays. This function accepts any decimal percentile between zero and one hundred.

        The returned map's keys correspond exactly to the percentiles provided. Iterating over the returned map will iterate in order of the requested percentiles as well.

        These percentiles are across all priorities combined into the same data set. If you want percentiles for a specific priority use getExecutionDelayPercentiles(TaskPriority, double...).

        Specified by:
        getExecutionDelayPercentiles in interface StatisticExecutor
        Parameters:
        percentiles - Percentiles requested, any decimal values between 0 and 100 (inclusive)
        Returns:
        Map with keys being the percentiles requested, value being the execution delay in milliseconds
      • getExecutionDelayPercentiles

        java.util.Map<java.lang.Double,​java.lang.Long> getExecutionDelayPercentiles​(TaskPriority priority,
                                                                                          double... percentiles)
        Gets percentile values for execution delays. This function accepts any decimal percentile between zero and one hundred.

        The returned map's keys correspond exactly to the percentiles provided. Iterating over the returned map will iterate in order of the requested percentiles as well.

        Parameters:
        priority - Specific task priority which statistics should be calculated against
        percentiles - Percentiles requested, any decimal values between 0 and 100 (inclusive)
        Returns:
        Map with keys being the percentiles requested, value being the execution delay in milliseconds
      • getExecutionDurationSamples

        java.util.List<java.lang.Long> getExecutionDurationSamples()
        Get raw sample data for task run durations. This raw data can be used for more advanced statistics which are not provided in this library. These can also be fed into utilities in StatisticsUtils for additional statistics.

        The returned result set includes all priorities. If you want durations for a specific priority use getExecutionDurationSamples(TaskPriority).

        Specified by:
        getExecutionDurationSamples in interface StatisticExecutor
        Returns:
        A list of task durations in milliseconds
      • getExecutionDurationSamples

        java.util.List<java.lang.Long> getExecutionDurationSamples​(TaskPriority priority)
        Get raw sample data for task run durations. This raw data can be used for more advanced statistics which are not provided in this library. These can also be fed into utilities in StatisticsUtils for additional statistics.

        These result set includes all priorities. If you want durations for a specific priority use getExecutionDurationSamples(TaskPriority).

        Parameters:
        priority - Task priority to provide samples for
        Returns:
        A list of task durations in milliseconds
      • getAverageExecutionDuration

        double getAverageExecutionDuration()
        Get the average duration that tasks submitted through this executor have spent executing. This only reports samples from tasks which have completed (in-progress tasks are not considered).

        This call averages over all priority types, if you want the duration for a specific priority use getAverageExecutionDuration(TaskPriority).

        Specified by:
        getAverageExecutionDuration in interface StatisticExecutor
        Returns:
        Average task execution duration in milliseconds
      • getAverageExecutionDuration

        double getAverageExecutionDuration​(TaskPriority priority)
        Get the average duration that tasks submitted through this executor have spent executing. This only reports samples from tasks which have completed (in-progress tasks are not considered).
        Parameters:
        priority - Specific task priority which statistics should be calculated against
        Returns:
        Average task execution duration in milliseconds
      • getExecutionDurationPercentiles

        java.util.Map<java.lang.Double,​java.lang.Long> getExecutionDurationPercentiles​(double... percentiles)
        Gets percentile values for execution duration. This function accepts any decimal percentile between zero and one hundred.

        The returned map's keys correspond exactly to the percentiles provided. Iterating over the returned map will iterate in order of the requested percentiles as well.

        These percentiles are across all priorities combined into the same data set. If you want percentiles for a specific priority use getExecutionDurationPercentiles(TaskPriority, double...).

        Specified by:
        getExecutionDurationPercentiles in interface StatisticExecutor
        Parameters:
        percentiles - Percentiles requested, any decimal values between 0 and 100 (inclusive)
        Returns:
        Map with keys being the percentiles requested, value being the execution duration in milliseconds
      • getExecutionDurationPercentiles

        java.util.Map<java.lang.Double,​java.lang.Long> getExecutionDurationPercentiles​(TaskPriority priority,
                                                                                             double... percentiles)
        Gets percentile values for execution duration. This function accepts any decimal percentile between zero and one hundred.

        The returned map's keys correspond exactly to the percentiles provided. Iterating over the returned map will iterate in order of the requested percentiles as well.

        Parameters:
        priority - Specific task priority which statistics should be calculated against
        percentiles - Percentiles requested, any decimal values between 0 and 100 (inclusive)
        Returns:
        Map with keys being the percentiles requested, value being the execution duration in milliseconds
      • getTotalExecutionCount

        long getTotalExecutionCount​(TaskPriority priority)
        Call to get the total quantity of tasks this executor has handled for a specific priority.
        Parameters:
        priority - Specific task priority which statistics should be calculated against
        Returns:
        total quantity of tasks run