codahale/metrics — pull request #447 by BGehrels (2013-08-05 16:46:56+00:00)
Title: Extended the AbstractInstrumentedFilter to support group aggregations on...

... HTTP status codes.

When using Metrics for monitoring, you want to find situations, where your application is somehow misbehaving. The HTTP spec groups HTTP status codes in 5 Blocks: 1xx (Informational), 2xx (Success), 3xx (Redirection), 4xx (Client Error) and 5xx (Server Error). Having counts for each of these groups is pretty useful. A misbehaving application will probably throw one of the 5xx codes. A crawler running amok will probably trigger a lot of 4xx errors. if all those run into the "others" bucket, it gives me nearly no information.

This commit changes AbstractInstrumentedFilters behaviour in the following way:
There are now three Types of meters
- The user defined Meters for individual status codes
- The 5 group meters for the status code groups mentioned above
- The group named "other"

Each request triggers either the group meters, or the "other" meter if there is an invalid status code. *In addition*, the user defined Meters will be triggered, if one of them matches the status code.