Package io.openems.common.utils
Class ThreadPoolUtils
java.lang.Object
io.openems.common.utils.ThreadPoolUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
debugLog
(ThreadPoolExecutor executor) Creates a debug log output with key metrics of the givenThreadPoolExecutor
.debugMetrics
(ThreadPoolExecutor executor) Creates a map of debug metrics of the givenThreadPoolExecutor
.static void
shutdownAndAwaitTermination
(ExecutorService pool, int timeoutSeconds) Shutdown aExecutorService
.
-
Method Details
-
shutdownAndAwaitTermination
Shutdown aExecutorService
.Source: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html
- Parameters:
pool
- theExecutorService
pooltimeoutSeconds
- the applied timeout (is applied twice in the worst case)
-
debugLog
Creates a debug log output with key metrics of the givenThreadPoolExecutor
.- Parameters:
executor
- the executor- Returns:
- a String
-
debugMetrics
Creates a map of debug metrics of the givenThreadPoolExecutor
.- Parameters:
executor
- the executor- Returns:
- a Map of key to value
-