Skip to content

Commit

Permalink
Add timestamps for body and req end
Browse files Browse the repository at this point in the history
  • Loading branch information
doochik committed Apr 3, 2024
1 parent 2ef9582 commit db81601
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,14 @@ class Request {
} );

if ( this.options.body ) {
this.req.write( this.options.body );
this.req.write( this.options.body, () => {
this.timestamps.body = Date.now();
} );
}

this.req.end();
this.req.end( () => {
this.timestamps.request_end = Date.now();
} );

} catch ( e ) {
this.do_fail( e );
Expand Down

0 comments on commit db81601

Please sign in to comment.