Skip to content

Commit

Permalink
Add timestamps for body and req end (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
doochik authored Apr 3, 2024
1 parent 2ef9582 commit 933e633
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 933e633

Please sign in to comment.