Record Class BrowserObservabilityRecorder.NetworkSnapshotEntry
java.lang.Object
java.lang.Record
com.shaft.tools.io.internal.BrowserObservabilityRecorder.NetworkSnapshotEntry
- Record Components:
id- 1-based position in the snapshot this entry was read frommethod- HTTP methodurl- request URLstatus- HTTP response status code, or0when the exchange failedmimeType- responseContent-Type, without parameters (blank when absent)durationMs- exchange duration in millisecondsrequestSizeBytes- request body size in bytesresponseSizeBytes- response body size in bytesfailureReason- safe failure reason, blank on successtimestamp- epoch millis when the exchange finishedbodyPreview- truncated, redacted response body preview as recorded for trace/HAR outputrequestHeaders- sanitized request headersresponseHeaders- sanitized response headers
- Enclosing class:
BrowserObservabilityRecorder
public static record BrowserObservabilityRecorder.NetworkSnapshotEntry(int id, String method, String url, int status, String mimeType, long durationMs, long requestSizeBytes, long responseSizeBytes, String failureReason, long timestamp, String bodyPreview, Map<String,String> requestHeaders, Map<String,String> responseHeaders)
extends Record
Read-only snapshot of one observed network transaction, safe to hand to a caller outside this
class (unlike
BrowserObservabilityRecorder.NetworkEvent, which stays private since it backs the mutable trace list).-
Constructor Summary
ConstructorsConstructorDescriptionNetworkSnapshotEntry(int id, String method, String url, int status, String mimeType, long durationMs, long requestSizeBytes, long responseSizeBytes, String failureReason, long timestamp, String bodyPreview, Map<String, String> requestHeaders, Map<String, String> responseHeaders) Creates an instance of aNetworkSnapshotEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebodyPreviewrecord component.longReturns the value of thedurationMsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailureReasonrecord component.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.method()Returns the value of themethodrecord component.mimeType()Returns the value of themimeTyperecord component.Returns the value of therequestHeadersrecord component.longReturns the value of therequestSizeBytesrecord component.Returns the value of theresponseHeadersrecord component.longReturns the value of theresponseSizeBytesrecord component.intstatus()Returns the value of thestatusrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
NetworkSnapshotEntry
public NetworkSnapshotEntry(int id, String method, String url, int status, String mimeType, long durationMs, long requestSizeBytes, long responseSizeBytes, String failureReason, long timestamp, String bodyPreview, Map<String, String> requestHeaders, Map<String, String> responseHeaders) Creates an instance of aNetworkSnapshotEntryrecord class.- Parameters:
id- the value for theidrecord componentmethod- the value for themethodrecord componenturl- the value for theurlrecord componentstatus- the value for thestatusrecord componentmimeType- the value for themimeTyperecord componentdurationMs- the value for thedurationMsrecord componentrequestSizeBytes- the value for therequestSizeBytesrecord componentresponseSizeBytes- the value for theresponseSizeBytesrecord componentfailureReason- the value for thefailureReasonrecord componenttimestamp- the value for thetimestamprecord componentbodyPreview- the value for thebodyPreviewrecord componentrequestHeaders- the value for therequestHeadersrecord componentresponseHeaders- the value for theresponseHeadersrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
method
-
url
-
status
-
mimeType
-
durationMs
public long durationMs()Returns the value of thedurationMsrecord component.- Returns:
- the value of the
durationMsrecord component
-
requestSizeBytes
public long requestSizeBytes()Returns the value of therequestSizeBytesrecord component.- Returns:
- the value of the
requestSizeBytesrecord component
-
responseSizeBytes
public long responseSizeBytes()Returns the value of theresponseSizeBytesrecord component.- Returns:
- the value of the
responseSizeBytesrecord component
-
failureReason
Returns the value of thefailureReasonrecord component.- Returns:
- the value of the
failureReasonrecord component
-
timestamp
-
bodyPreview
Returns the value of thebodyPreviewrecord component.- Returns:
- the value of the
bodyPreviewrecord component
-
requestHeaders
Returns the value of therequestHeadersrecord component.- Returns:
- the value of the
requestHeadersrecord component
-
responseHeaders
Returns the value of theresponseHeadersrecord component.- Returns:
- the value of the
responseHeadersrecord component
-