 
 
 (def ^ExecutorService dispatch-pool
-  (Executors/newCachedThreadPool
-   (create-thread-factory dispatch-pool-thread-format
-                          dispatch-pool-thread-counter)))
+  (let [registry (SharedMetricRegistries/getOrCreate "github-bot-app")]
+    (InstrumentedExecutorService.
+     (Executors/newCachedThreadPool
+     (InstrumentedThreadFactory.
+      (create-thread-factory dispatch-pool-thread-format
+                             dispatch-pool-thread-counter)
+      registry
+      "github-bot-app-dispatch-threads"))
+     registry
+     "github-bot-app-dispatch-pool")))
 
 
 (defn dispatch



(def ^ScheduledExecutorService scheduled-pool
  (Executors/newSingleThreadScheduledExecutor
   (create-thread-factory scheduled-pool-thread-format
                          scheduled-pool-thread-counter
                          true)))

(defn schedule
  [^Long delay ^TimeUnit time-unit ^Runnable r]

  (:import [java.util.concurrent Executors ExecutorService
                                 ScheduledExecutorService ThreadFactory
                                 TimeUnit]
           java.util.concurrent.atomic.AtomicInteger
           [com.codahale.metrics
            InstrumentedExecutorService
            InstrumentedScheduledExecutorService
            InstrumentedThreadFactory
            SharedMetricRegistries]))


(defn- create-thread-factory
