Commits

Steve Losh committed a3a2353

Document Ring instrumentation middleware.

  • Participants
  • Parent commits 0589350

Comments (0)

Files changed (2)

File docs/source/ring.rst

 This will add a ``/metrics/`` URL that will show all the metrics for the app.
 The trailing slash is required.
 
+This middleware works great with Noir, too.
+
 If you want to use a different endpoint you can pass it as a parameter::
 
     (use '[metrics.ring.expose :only (expose-metrics-as-json)])
 
 **TODO**: Document each individual type.
 
+Instrumenting a Ring App
+------------------------
+
+You can add some common metrics by using the ``instrument`` middleware::
+
+    (use '[metrics.ring.instrument :only (instrument)])
+
+    (def app (instrument app))
+
+This will add a number of metrics, listed below.
+
+This middleware works great with Noir, too.
+
+``ring.requests.active``
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+A counter tracking the number of currently open requests.
+
+``ring.requests.rate``
+~~~~~~~~~~~~~~~~~~~~~~
+
+A meter measuring the rate of all incoming requests.
+
+``ring.requests.rate.*``
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Six separate meters (ending in ``GET``, ``POST``, etc) measuring the rate of
+incoming requests of a given type.
+
+``ring.responses.rate``
+~~~~~~~~~~~~~~~~~~~~~~~
+
+A meter measuring the rate of all outgoing responses.
+
+``ring.responses.rate.*``
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Four separate meters (ending in ``2xx``, ``3xx``, etc) measuring the rate of
+outgoing responses of a given type.
+
+``ring.handling-time.*``
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Six separate timers (ending in ``GET``, ``POST``, etc) measuring the time taken
+to handle incoming requests of a given type.
+
 Troubleshooting
 ---------------
 
-(defproject metrics-clojure "0.7.0"
+(defproject metrics-clojure "0.7.1-SNAPSHOT"
   :description "A Clojure façade for Coda Hale's metrics library."
   :dependencies [[org.clojure/clojure "[1.2.1,1.3.0]"]
                  [com.yammer.metrics/metrics-core "2.0.1"]]