Bun

class

perf_hooks.PerformanceResourceTiming

class PerformanceResourceTiming

Provides detailed network timing data regarding the loading of an application's resources.

The constructor of this class is not exposed to users directly.

  • readonly connectEnd: number

    The high resolution millisecond timestamp representing the time immediately after Node.js finishes establishing the connection to the server to retrieve the resource.

  • readonly connectStart: number

    The high resolution millisecond timestamp representing the time immediately before Node.js starts to establish the connection to the server to retrieve the resource.

  • readonly decodedBodySize: number

    A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after removing any applied content-codings.

  • readonly detail?: unknown

    Additional detail specific to the entryType.

  • readonly domainLookupEnd: number

    The high resolution millisecond timestamp representing the time immediately after the Node.js finished the domain name lookup for the resource.

  • readonly domainLookupStart: number

    The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup for the resource.

  • readonly duration: number

    The total number of milliseconds elapsed for this entry. This value will not be meaningful for all Performance Entry types.

  • readonly encodedBodySize: number

    A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings.

  • readonly entryType: 'resource'

    The type of the performance entry. It may be one of:

    • 'node' (Node.js only)
    • 'mark' (available on the Web)
    • 'measure' (available on the Web)
    • 'gc' (Node.js only)
    • 'function' (Node.js only)
    • 'http2' (Node.js only)
    • 'http' (Node.js only)
  • readonly fetchStart: number

    The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.

  • readonly name: string

    The name of the performance entry.

  • readonly redirectEnd: number

    The high resolution millisecond timestamp that will be created immediately after receiving the last byte of the response of the last redirect.

  • readonly redirectStart: number

    The high resolution millisecond timestamp that represents the start time of the fetch which initiates the redirect.

  • readonly requestStart: number

    The high resolution millisecond timestamp representing the time immediately before Node.js receives the first byte of the response from the server.

  • readonly responseEnd: number

    The high resolution millisecond timestamp representing the time immediately after Node.js receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.

  • readonly secureConnectionStart: number

    The high resolution millisecond timestamp representing the time immediately before Node.js starts the handshake process to secure the current connection.

  • readonly startTime: number

    The high resolution millisecond timestamp marking the starting time of the Performance Entry.

  • readonly transferSize: number

    A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body.

  • readonly workerStart: number

    The high resolution millisecond timestamp at immediately before dispatching the fetch request. If the resource is not intercepted by a worker the property will always return 0.

  • toJSON(): any;

    Returns a object that is the JSON representation of the PerformanceResourceTiming object