From db81601e2c66826b3a0e7bf2935ecc50ce87b626 Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Wed, 3 Apr 2024 18:37:08 +0300 Subject: [PATCH] Add timestamps for body and req end --- lib/request.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/request.js b/lib/request.js index c0d3d86..ed09107 100644 --- a/lib/request.js +++ b/lib/request.js @@ -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 );