@nxtedition/nxt-undici 6.4.8 → 6.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,9 +7,8 @@ class Handler extends DecoratorHandler {
7
7
  #abort
8
8
  #aborted = false
9
9
  #pos = 0
10
- #created = performance.now()
11
10
  #timing = {
12
- created: -1,
11
+ created: performance.now(),
13
12
  connect: -1,
14
13
  headers: -1,
15
14
  data: -1,
@@ -36,7 +35,7 @@ class Handler extends DecoratorHandler {
36
35
  this.#pos = 0
37
36
  this.#abort = abort
38
37
 
39
- this.#timing.connect = performance.now() - this.#created
38
+ this.#timing.connect = performance.now() - this.#timing.created
40
39
  this.#timing.headers = -1
41
40
  this.#timing.data = -1
42
41
  this.#timing.end = -1
@@ -48,7 +47,7 @@ class Handler extends DecoratorHandler {
48
47
  }
49
48
 
50
49
  onUpgrade(statusCode, headers, socket) {
51
- this.#timing.headers = performance.now() - this.#created
50
+ this.#timing.headers = performance.now() - this.#timing.created
52
51
 
53
52
  this.#logger.debug(
54
53
  {
@@ -66,7 +65,7 @@ class Handler extends DecoratorHandler {
66
65
  }
67
66
 
68
67
  onHeaders(statusCode, headers, resume) {
69
- this.#timing.headers = performance.now() - this.#created
68
+ this.#timing.headers = performance.now() - this.#timing.created
70
69
  this.#statusCode = statusCode
71
70
  this.#headers = headers
72
71
 
@@ -75,7 +74,7 @@ class Handler extends DecoratorHandler {
75
74
 
76
75
  onData(chunk) {
77
76
  if (this.#timing.data === -1) {
78
- this.#timing.data = performance.now() - this.#created
77
+ this.#timing.data = performance.now() - this.#timing.created
79
78
  }
80
79
 
81
80
  this.#pos += chunk.length
@@ -84,7 +83,7 @@ class Handler extends DecoratorHandler {
84
83
  }
85
84
 
86
85
  onComplete() {
87
- this.#timing.end = performance.now() - this.#created
86
+ this.#timing.end = performance.now() - this.#timing.created
88
87
 
89
88
  const data = {
90
89
  ureq: this.#opts,
@@ -110,7 +109,7 @@ class Handler extends DecoratorHandler {
110
109
  }
111
110
 
112
111
  onError(err) {
113
- this.#timing.end = performance.now() - this.#created
112
+ this.#timing.end = performance.now() - this.#timing.created
114
113
 
115
114
  const data = {
116
115
  ures: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "6.4.8",
3
+ "version": "6.4.11",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",