Package io.undertow.attribute
Class ResponseTimeAttribute
- java.lang.Object
-
- io.undertow.attribute.ResponseTimeAttribute
-
- All Implemented Interfaces:
ExchangeAttribute
public class ResponseTimeAttribute extends java.lang.Object implements ExchangeAttribute
The response time This will only work ifUndertowOptions.RECORD_REQUEST_START_TIMEhas been set
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResponseTimeAttribute.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringRESPONSE_TIME_MICROSstatic java.lang.StringRESPONSE_TIME_MILLISstatic java.lang.StringRESPONSE_TIME_MILLIS_SHORTstatic java.lang.StringRESPONSE_TIME_NANOSstatic java.lang.StringRESPONSE_TIME_SECONDS_SHORT
-
Constructor Summary
Constructors Constructor Description ResponseTimeAttribute(java.util.concurrent.TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringreadAttribute(HttpServerExchange exchange)Resolve the attribute from the HTTP server exchange.java.lang.StringtoString()voidwriteAttribute(HttpServerExchange exchange, java.lang.String newValue)Sets a new value for the attribute.
-
-
-
Field Detail
-
RESPONSE_TIME_MILLIS_SHORT
public static final java.lang.String RESPONSE_TIME_MILLIS_SHORT
- See Also:
- Constant Field Values
-
RESPONSE_TIME_SECONDS_SHORT
public static final java.lang.String RESPONSE_TIME_SECONDS_SHORT
- See Also:
- Constant Field Values
-
RESPONSE_TIME_MILLIS
public static final java.lang.String RESPONSE_TIME_MILLIS
- See Also:
- Constant Field Values
-
RESPONSE_TIME_MICROS
public static final java.lang.String RESPONSE_TIME_MICROS
- See Also:
- Constant Field Values
-
RESPONSE_TIME_NANOS
public static final java.lang.String RESPONSE_TIME_NANOS
- See Also:
- Constant Field Values
-
-
Method Detail
-
readAttribute
public java.lang.String readAttribute(HttpServerExchange exchange)
Description copied from interface:ExchangeAttributeResolve the attribute from the HTTP server exchange. This may return null if the attribute is not present.- Specified by:
readAttributein interfaceExchangeAttribute- Parameters:
exchange- The exchange- Returns:
- The attribute
-
writeAttribute
public void writeAttribute(HttpServerExchange exchange, java.lang.String newValue) throws ReadOnlyAttributeException
Description copied from interface:ExchangeAttributeSets a new value for the attribute. Not all attributes are writable.- Specified by:
writeAttributein interfaceExchangeAttribute- Parameters:
exchange- The exchangenewValue- The new value for the attribute- Throws:
ReadOnlyAttributeException- when attribute cannot be written
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-