public final class RequestTelemetry extends BaseTelemetry<RequestData>
TelemetryClient
Constructor and Description |
---|
RequestTelemetry()
Initializes a new instance of the HttpRequestTelemetry class.
|
RequestTelemetry(java.lang.String name,
java.util.Date timestamp,
Duration duration,
java.lang.String responseCode,
boolean success)
Initializes a new instance of the HttpRequestTelemetry class with the given name,
time stamp, duration, HTTP response code and success property values.
|
RequestTelemetry(java.lang.String name,
java.util.Date timestamp,
long duration,
java.lang.String responseCode,
boolean success)
Initializes a new instance of the HttpRequestTelemetry class with the given name,
time stamp, duration, HTTP response code and success property values.
|
Modifier and Type | Method and Description |
---|---|
protected void |
additionalSanitize()
Concrete classes should implement this method
|
protected RequestData |
getData()
Concrete classes should implement this method which supplies the
data structure that this instance works with, which needs to implement
SendableData |
Duration |
getDuration()
Gets the amount of time it took the application to handle the request.
|
java.lang.String |
getHttpMethod()
Gets the HTTP method of the request.
|
java.lang.String |
getId()
Gets the unique identifier of the request.
|
java.lang.String |
getName()
Gets or human-readable name of the requested page.
|
java.lang.String |
getResponseCode()
Gets response code returned by the application after handling the request.
|
java.net.URL |
getUrl()
Gets request url (optional).
|
boolean |
isSuccess()
Gets a value indicating whether application handled the request successfully.
|
void |
setDuration(Duration duration)
Sets the amount of time it took the application to handle the request.
|
void |
setHttpMethod(java.lang.String httpMethod)
Sets the HTTP method of the request.
|
void |
setId(java.lang.String id)
Sets the unique identifier of the request.
|
void |
setName(java.lang.String name)
Sets or human-readable name of the requested page.
|
void |
setResponseCode(java.lang.String responseCode)
Sets response code returned by the application after handling the request.
|
void |
setSuccess(boolean success)
Sets a value indicating whether application handled the request successfully.
|
void |
setTimestamp(java.util.Date timestamp)
Sets the StartTime.
|
void |
setUrl(java.lang.String url)
Sets request url.
|
void |
setUrl(java.net.URL url)
Sets request url
|
getContext, getProperties, getSequence, getTimestamp, initialize, sanitize, serialize, setSequence
public RequestTelemetry()
public RequestTelemetry(java.lang.String name, java.util.Date timestamp, long duration, java.lang.String responseCode, boolean success)
name
- A user-friendly name for the request.timestamp
- The time of the request.duration
- The duration, in milliseconds, of the request processing.responseCode
- The HTTP response code.success
- 'true' if the request was a success, 'false' otherwise.public RequestTelemetry(java.lang.String name, java.util.Date timestamp, Duration duration, java.lang.String responseCode, boolean success)
name
- A user-friendly name for the request.timestamp
- The time of the request.duration
- The duration, as an Duration
instance, of the request processing.responseCode
- The HTTP response code.success
- 'true' if the request was a success, 'false' otherwise.public void setTimestamp(java.util.Date timestamp)
setTimestamp
in interface Telemetry
setTimestamp
in class BaseTelemetry<RequestData>
timestamp
- he timestamp as Date.public java.lang.String getName()
public void setName(java.lang.String name)
name
- A human-readable namepublic java.lang.String getId()
public void setId(java.lang.String id)
id
- Unique identifierpublic java.lang.String getResponseCode()
public void setResponseCode(java.lang.String responseCode)
responseCode
- Application's response codepublic boolean isSuccess()
public void setSuccess(boolean success)
success
- Success indicationpublic Duration getDuration()
public void setDuration(Duration duration)
duration
- Amount of time in captured in a Duration
.public java.net.URL getUrl() throws java.net.MalformedURLException
java.net.MalformedURLException
- if the url is malformedpublic void setUrl(java.net.URL url)
url
- The URLpublic void setUrl(java.lang.String url) throws java.net.MalformedURLException
url
- The url to storejava.net.MalformedURLException
- If the url is malformedpublic java.lang.String getHttpMethod()
public void setHttpMethod(java.lang.String httpMethod)
httpMethod
- The HTTP methodprotected void additionalSanitize()
BaseTelemetry
additionalSanitize
in class BaseTelemetry<RequestData>
protected RequestData getData()
BaseTelemetry
SendableData
getData
in class BaseTelemetry<RequestData>