class CountedRejectedExecutionHandler implements RejectedExecutionHandler {

  public static void monitorRejections(
      MeterRegistry registry, ThreadPoolExecutor executor, String name, Iterable<Tag> tags) {
    executor.setRejectedExecutionHandler(
        new CountedRejectedExecutionHandler(
            executor.getRejectedExecutionHandler(), registry, name, tags));
  }

  public  CountedRejectedExecutionHandler(
      RejectedExecutionHandler delegate, MeterRegistry registry, String name, Iterable<Tag> tags);

}