Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
  2. 2,
  3. 2,
  4. 1,
  5. TimeUnit.MINUTES,
  6. new ArrayBlockingQueue<Runnable>(100),
  7. new ThreadPoolExecutor.DiscardPolicy());
  8.  
  9. metricRegistry.register(name(ThreadPoolExecutor.class, "ThreadPoolRemainingCapacity"), (Gauge<Integer>) () -> threadPoolExecutor.getQueue().remainingCapacity());
  10. metricRegistry.register(name(ThreadPoolExecutor.class, "ThreadPoolOccupiedCapacity"), (Gauge<Integer>) () -> threadPoolExecutor.getQueue().size());
  11.  
  12. return threadPoolExecutor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement