[]previous and next page

ServerTimingOptions

The serverTiming option as an object.

The serverTiming option as an object.

Import#

ts
import type { ServerTimingOptions } from "@shadow-js/dusk/server";

Signature#

ts
interface ServerTimingOptions {
  /**
   * Send the `Server-Timing` header. Default `true`. `false` records the timings for `onTimings` only, which keeps
   * the numbers out of responses.
   */
  readonly header?: boolean;
  /**
   * Called once per request when it is over (for a streamed page, when the body ends; for a canceled or timed-out
   * request, when it is abandoned). A throw is reported to the error sink (phase `instrumentation`) and never reaches
   * the client.
   */
  readonly onTimings?: (timings: RequestTimings) => void;
}

Members#

Name Type Description
header? readonly header?: boolean Send the Server-Timing header. Default true. false records the timings for onTimings only, which keeps the numbers out of responses.
onTimings? readonly onTimings?: (timings: RequestTimings) => void Called once per request when it is over (for a streamed page, when the body ends; for a canceled or timed-out request, when it is abandoned). A throw is reported to the error sink (phase instrumentation) and never reaches the client.