metrics-clojure / docs / source / ring.rst

Diff from to

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
 ---------------
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.