Dropwizard Metrics instrumentation for core.cache caches.
To count the cache hits and the misses, wrap the cache in
instrumented-cache-factory
.
(def my-registry (MetricsRegistry.))
(defn create-cache []
(-> (lru-cache-factory {})
(instrumented-cache-factory :registry my-registry)))
If you follow the usage pattern recommend by core.cache documentation and wrap
the cache in an atom, you can measure the cache size with
cache-size-gauge
.
(def my-cache-a (atom (create-cache)))
(.register my-registry "clojure.core.cache.size" (cache-size-gauge my-cache-a))
Dropwizard Metrics instrumentation for core.cache caches. ## Usage To count the cache hits and the misses, wrap the cache in [[instrumented-cache-factory]]. (def my-registry (MetricsRegistry.)) (defn create-cache [] (-> (lru-cache-factory {}) (instrumented-cache-factory :registry my-registry))) If you follow the usage pattern recommend by core.cache documentation and wrap the cache in an atom, you can measure the cache size with [[cache-size-gauge]]. (def my-cache-a (atom (create-cache))) (.register my-registry "clojure.core.cache.size" (cache-size-gauge my-cache-a))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close