Interface StatisticPriorityScheduler
-
- All Superinterfaces:
java.util.concurrent.Executor,PrioritySchedulerService,SchedulerService,StatisticExecutor,SubmitterExecutor,SubmitterScheduler
- All Known Implementing Classes:
NoThreadSchedulerStatisticTracker,PrioritySchedulerStatisticTracker,SingleThreadSchedulerStatisticTracker
public interface StatisticPriorityScheduler extends StatisticExecutor, PrioritySchedulerService
An extension ofStatisticExecutor, defining specific behavior when the statistic tracker is implementing for a scheduler which has a concept of task priorities.- Since:
- 4.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublegetAverageExecutionDelay()This reports the rolling average delay from when a task was expected to run, till when the executor actually started the task.doublegetAverageExecutionDelay(TaskPriority priority)Gets the average delay from when the task is ready, to when it is actually executed.doublegetAverageExecutionDuration()Get the average duration that tasks submitted through this executor have spent executing.doublegetAverageExecutionDuration(TaskPriority priority)Get the average duration that tasks submitted through this executor have spent executing.java.util.Map<java.lang.Double,java.lang.Long>getExecutionDelayPercentiles(double... percentiles)Gets percentile values for execution delays.java.util.Map<java.lang.Double,java.lang.Long>getExecutionDelayPercentiles(TaskPriority priority, double... percentiles)Gets percentile values for execution delays.java.util.List<java.lang.Long>getExecutionDelaySamples()Get raw sample data for task execution delays.java.util.List<java.lang.Long>getExecutionDelaySamples(TaskPriority priority)Call to get a list of all currently recorded times for execution delays.java.util.Map<java.lang.Double,java.lang.Long>getExecutionDurationPercentiles(double... percentiles)Gets percentile values for execution duration.java.util.Map<java.lang.Double,java.lang.Long>getExecutionDurationPercentiles(TaskPriority priority, double... percentiles)Gets percentile values for execution duration.java.util.List<java.lang.Long>getExecutionDurationSamples()Get raw sample data for task run durations.java.util.List<java.lang.Long>getExecutionDurationSamples(TaskPriority priority)Get raw sample data for task run durations.longgetTotalExecutionCount(TaskPriority priority)Call to get the total quantity of tasks this executor has handled for a specific priority.-
Methods inherited from interface org.threadly.concurrent.PrioritySchedulerService
execute, getDefaultPriority, getMaxWaitForLowPriority, getQueuedTaskCount, getWaitingForExecutionTaskCount, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, submit, submit, submit, submitScheduled, submitScheduled, submitScheduled
-
Methods inherited from interface org.threadly.concurrent.SchedulerService
getActiveTaskCount, getQueuedTaskCount, getWaitingForExecutionTaskCount, isShutdown, remove, remove
-
Methods inherited from interface org.threadly.concurrent.statistics.StatisticExecutor
getLongRunningTasks, getLongRunningTasksQty, getQueuedTaskCount, getTotalExecutionCount, resetCollectedStats
-
Methods inherited from interface org.threadly.concurrent.SubmitterExecutor
submit, submit, submit
-
Methods inherited from interface org.threadly.concurrent.SubmitterScheduler
schedule, scheduleAtFixedRate, scheduleWithFixedDelay, submitScheduled, submitScheduled, submitScheduled
-
-
-
-
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 inStatisticsUtilsfor additional statistics.The returned result set includes all priorities. If you want durations for a specific priority use
getExecutionDelaySamples(TaskPriority).- Specified by:
getExecutionDelaySamplesin interfaceStatisticExecutor- 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 forgetAverageExecutionDelay(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-1if no samples have been collected yet. This call averages over all priority types, if you want the delay for a specific priority usegetAverageExecutionDelay(TaskPriority).- Specified by:
getAverageExecutionDelayin interfaceStatisticExecutor- 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:
getExecutionDelayPercentilesin interfaceStatisticExecutor- 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 againstpercentiles- 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 inStatisticsUtilsfor additional statistics.The returned result set includes all priorities. If you want durations for a specific priority use
getExecutionDurationSamples(TaskPriority).- Specified by:
getExecutionDurationSamplesin interfaceStatisticExecutor- 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 inStatisticsUtilsfor 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:
getAverageExecutionDurationin interfaceStatisticExecutor- 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:
getExecutionDurationPercentilesin interfaceStatisticExecutor- 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 againstpercentiles- 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
-
-