Code example for ScheduledThreadPoolExecutor

Methods: getActiveCountgetCompletedTaskCountgetPoolSize

0
 
	@Override 
	public Map<String, Object> getStats() {
		final String prefix = "thread-pools." + getName() + ".";
		final Map<String, Object> result = new HashMap<>();
		result.put(prefix + "activeCount", executorService.getActiveCount());
		result.put(prefix + "poolSize", executorService.getPoolSize());
		result.put(prefix + "completedTaskCount", executorService.getCompletedTaskCount());
		return result; 
	} 
} 
Experience pair programming with AI  Get Codota for Java