diff options
Diffstat (limited to 'jdisc_core')
-rw-r--r-- | jdisc_core/src/main/java/com/yahoo/jdisc/Request.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java index e0292bbe026..bce6f72c1fc 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java @@ -48,6 +48,11 @@ public class Request extends AbstractResource { private boolean serverRequest; private Long timeout; private URI uri; + private RequestType requestType; + + public enum RequestType { + READ, WRITE, MONITORING + } /** * <p>Creates a new instance of this class. As a {@link ServerProvider} you need to inject a {@link @@ -326,6 +331,12 @@ public class Request extends AbstractResource { return unit.convert(creationTime, TimeUnit.MILLISECONDS); } + /** Sets the type classification of this request for metric collection purposes */ + public void setRequestType(RequestType requestType) { this.requestType = requestType; } + + /** Returns the type classification of this request for metric collection purposes, or null if not set */ + public RequestType getRequestType() { return requestType; } + /** * <p>Returns whether or not this Request has been cancelled. This can be thought of as the {@link * Thread#isInterrupted()} of Requests - it does not enforce anything in ways of blocking the Request, it is simply |