Record Class NetworkTiming

java.lang.Object
java.lang.Record
com.shaft.capture.model.network.NetworkTiming
Record Components:
blocked - time waiting for a network connection to become available
dns - time spent resolving DNS
connect - time spent establishing the connection
send - time spent sending the request
ttfb - time to first byte of the response
receive - time spent downloading the response body

public record NetworkTiming(Duration blocked, Duration dns, Duration connect, Duration send, Duration ttfb, Duration receive) extends Record
Performance timing measurements for a network transaction, mirroring the conventional browser DevTools/HAR timing breakdown. All durations are nullable and may be absent when a phase was not measured or does not apply.
  • Constructor Details

    • NetworkTiming

      public NetworkTiming(Duration blocked, Duration dns, Duration connect, Duration send, Duration ttfb, Duration receive)
      Creates immutable network timing evidence. Every phase is optional; negative durations are rejected since they cannot represent real elapsed time.
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • blocked

      public Duration blocked()
      Returns the value of the blocked record component.
      Returns:
      the value of the blocked record component
    • dns

      public Duration dns()
      Returns the value of the dns record component.
      Returns:
      the value of the dns record component
    • connect

      public Duration connect()
      Returns the value of the connect record component.
      Returns:
      the value of the connect record component
    • send

      public Duration send()
      Returns the value of the send record component.
      Returns:
      the value of the send record component
    • ttfb

      public Duration ttfb()
      Returns the value of the ttfb record component.
      Returns:
      the value of the ttfb record component
    • receive

      public Duration receive()
      Returns the value of the receive record component.
      Returns:
      the value of the receive record component