               []
               (let [[last-time sum] @meter
                     elapsed (/ (- (System/nanoTime) last-time) 1e9)
-                    record-event (:record-event store)]
+                    record! (:recording-fn store)
+                    label (meter-label store)]
                 (log/tracef "Metered %s of %s block %s: %s (%s)"
-                            (name metric-type) (:label store) block-id
+                            (name metric-type) label block-id
                             (format-bytes sum "B")
                             (format-bytes (/ sum elapsed) "Bps"))
-                (record-event
+                (record!
                   store
                   {:type metric-type
-                   :label (:label store)
+                   :label label
                    :block block-id
                    :value sum})
                 (vreset! [(System/nanoTime) 0])))]



(defn metered-block-store
  "Creates a new metered block store. The `record-event` function will be
  called once for each measurement, with the meter store record and a map
  containing the metric name string, a numeric value, and possibly other data."
  [record-event & {:as opts}]
  (when-not (fn? record-event)
    (throw (IllegalArgumentException.
             (str "First argument must be a metric recording function: "
                  (pr-str record-event)))))
  (map->MeteredBlockStore
    (assoc opts :record-event record-event)))

;; some cases if care is not taken.

(defrecord MeteredBlockStore
  [store label recording-fn]

  store/BlockStore

