Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
- 2,
- 2,
- 1,
- TimeUnit.MINUTES,
- new ArrayBlockingQueue<Runnable>(100),
- new ThreadPoolExecutor.DiscardPolicy());
- metricRegistry.register(name(ThreadPoolExecutor.class, "ThreadPoolRemainingCapacity"), (Gauge<Integer>) () -> threadPoolExecutor.getQueue().remainingCapacity());
- metricRegistry.register(name(ThreadPoolExecutor.class, "ThreadPoolOccupiedCapacity"), (Gauge<Integer>) () -> threadPoolExecutor.getQueue().size());
- return threadPoolExecutor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement