-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add detailed response codes for ResponseMetered annotation (#3043)
The `ResponseMetered` annotation used to provide top level 1xx/2xx/3xx/4xx/5xx meters. There are many use cases where users care about specific response codes like 201/304/401/503 and end up manually instrumenting code to create these meters. This change set adds meters for individual response codes in addition to the 1xx/2xx/3xx/4xx/5xx meters in the `ResponseMetered` annotation depending on the configured `ResponseMeteredLevel`.
- Loading branch information
Showing
8 changed files
with
162 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
metrics-annotation/src/main/java/com/codahale/metrics/annotation/ResponseMeteredLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.codahale.metrics.annotation; | ||
|
||
/** | ||
* {@link ResponseMeteredLevel} is a parameter for the {@link ResponseMetered} annotation. | ||
* The constants of this enumerated type decide what meters are included when a class | ||
* or method is annotated with the {@link ResponseMetered} annotation. | ||
*/ | ||
public enum ResponseMeteredLevel { | ||
/** | ||
* Include meters for 1xx/2xx/3xx/4xx/5xx responses | ||
*/ | ||
COARSE, | ||
|
||
/** | ||
* Include meters for every response code (200, 201, 303, 304, 401, 404, 501, etc.) | ||
*/ | ||
DETAILED, | ||
|
||
/** | ||
* Include meters for every response code in addition to top level 1xx/2xx/3xx/4xx/5xx responses | ||
*/ | ||
ALL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
...om/codahale/metrics/jersey2/resources/InstrumentedSubResourceResponseMeteredPerClass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters