Skip to content

Commit

Permalink
copy over docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Sep 17, 2024
1 parent 5d4f149 commit 9bb91cc
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 3 deletions.
23 changes: 23 additions & 0 deletions docs/src/api/class-apiresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,26 @@ Returns the text representation of response body.
- returns: <[string]>

Contains the URL of the response.

## method: APIResponse.timing
* since: v1.48
- returns: <[Object]>
- `startTime` <[float]> Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
- `domainLookupStart` <[float]> Time immediately before the client starts the domain name lookup for the
resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `domainLookupEnd` <[float]> Time immediately after the client ends the domain name lookup for the resource.
The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectStart` <[float]> Time immediately before the client starts establishing the connection to the server
to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `secureConnectionStart` <[float]> Time immediately before the client starts the handshake process to secure the
current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectEnd` <[float]> Time immediately before the client starts establishing the connection to the server
to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `requestStart` <[float]> Time immediately before the client starts requesting the resource from the server. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseStart` <[float]> Time immediately after the client receives the first byte of the response from the server. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseEnd` <[float]> Time immediately after the client receives the last byte of the resource or immediately
before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to
`startTime`, -1 if not available.

Returns resource timing information for given response. Find more information at
[Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
2 changes: 1 addition & 1 deletion docs/src/api/class-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Returns resource size information for given request.
- `startTime` <[float]> Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
- `domainLookupStart` <[float]> Time immediately before the browser starts the domain name lookup for the
resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `domainLookupEnd` <[float]> Time immediately after the browser starts the domain name lookup for the resource.
- `domainLookupEnd` <[float]> Time immediately after the browser ends the domain name lookup for the resource.
The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectStart` <[float]> Time immediately before the user agent starts establishing the connection to the server
to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
Expand Down
64 changes: 62 additions & 2 deletions packages/playwright-core/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17364,6 +17364,66 @@ export interface APIResponse {
*/
text(): Promise<string>;

/**
* Returns resource timing information for given response. Find more information at
* [Resource Timing API](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming).
*/
timing(): {
/**
* Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
*/
startTime: number;

/**
* Time immediately before the client starts the domain name lookup for the resource. The value is given in
* milliseconds relative to `startTime`, -1 if not available.
*/
domainLookupStart: number;

/**
* Time immediately after the client ends the domain name lookup for the resource. The value is given in milliseconds
* relative to `startTime`, -1 if not available.
*/
domainLookupEnd: number;

/**
* Time immediately before the client starts establishing the connection to the server to retrieve the resource. The
* value is given in milliseconds relative to `startTime`, -1 if not available.
*/
connectStart: number;

/**
* Time immediately before the client starts the handshake process to secure the current connection. The value is
* given in milliseconds relative to `startTime`, -1 if not available.
*/
secureConnectionStart: number;

/**
* Time immediately before the client starts establishing the connection to the server to retrieve the resource. The
* value is given in milliseconds relative to `startTime`, -1 if not available.
*/
connectEnd: number;

/**
* Time immediately before the client starts requesting the resource from the server. The value is given in
* milliseconds relative to `startTime`, -1 if not available.
*/
requestStart: number;

/**
* Time immediately after the client receives the first byte of the response from the server. The value is given in
* milliseconds relative to `startTime`, -1 if not available.
*/
responseStart: number;

/**
* Time immediately after the client receives the last byte of the resource or immediately before the transport
* connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not
* available.
*/
responseEnd: number;
};

/**
* Contains the URL of the response.
*/
Expand Down Expand Up @@ -19305,8 +19365,8 @@ export interface Request {
domainLookupStart: number;

/**
* Time immediately after the browser starts the domain name lookup for the resource. The value is given in
* milliseconds relative to `startTime`, -1 if not available.
* Time immediately after the browser ends the domain name lookup for the resource. The value is given in milliseconds
* relative to `startTime`, -1 if not available.
*/
domainLookupEnd: number;

Expand Down

0 comments on commit 9bb91cc

Please sign in to comment.