@nxtedition/lib 20.4.1 → 20.4.2
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.
- package/http.js +12 -8
- package/package.json +1 -1
- package/serializers.js +1 -2
package/http.js
CHANGED
|
@@ -165,7 +165,7 @@ export class ServerResponse extends http.ServerResponse {
|
|
|
165
165
|
connect: -1,
|
|
166
166
|
headers: -1,
|
|
167
167
|
data: -1,
|
|
168
|
-
|
|
168
|
+
end: -1,
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
get timing() {
|
|
@@ -216,7 +216,8 @@ export class ServerResponse extends http.ServerResponse {
|
|
|
216
216
|
this.#timing.headers = this.#timing.data
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
this.#timing.
|
|
219
|
+
this.#timing.end = performance.now() - this.#now
|
|
220
|
+
this.#now += this.#timing.end
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
return super.end(chunk, encoding, callback)
|
|
@@ -224,8 +225,9 @@ export class ServerResponse extends http.ServerResponse {
|
|
|
224
225
|
|
|
225
226
|
destroy(err) {
|
|
226
227
|
if (!this.destroyed) {
|
|
227
|
-
if (this.#timing.
|
|
228
|
-
this.#timing.
|
|
228
|
+
if (this.#timing.end === -1) {
|
|
229
|
+
this.#timing.end = performance.now() - this.#now
|
|
230
|
+
this.#now += this.#timing.end
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
|
|
@@ -240,7 +242,7 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
|
|
|
240
242
|
connect: -1,
|
|
241
243
|
headers: -1,
|
|
242
244
|
data: -1,
|
|
243
|
-
|
|
245
|
+
end: -1,
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
get timing() {
|
|
@@ -291,7 +293,8 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
|
|
|
291
293
|
this.#timing.headers = this.#timing.data
|
|
292
294
|
}
|
|
293
295
|
|
|
294
|
-
this.#timing.
|
|
296
|
+
this.#timing.end = performance.now() - this.#now
|
|
297
|
+
this.#now += this.#timing.end
|
|
295
298
|
}
|
|
296
299
|
|
|
297
300
|
return super.end(chunk, encoding, callback)
|
|
@@ -299,8 +302,9 @@ export class Http2ServerResponse extends http2.Http2ServerResponse {
|
|
|
299
302
|
|
|
300
303
|
destroy(err) {
|
|
301
304
|
if (!this.destroyed) {
|
|
302
|
-
if (this.#timing.
|
|
303
|
-
this.#timing.
|
|
305
|
+
if (this.#timing.end === -1) {
|
|
306
|
+
this.#timing.end = performance.now() - this.#now
|
|
307
|
+
this.#now += this.#timing.end
|
|
304
308
|
}
|
|
305
309
|
}
|
|
306
310
|
|
package/package.json
CHANGED
package/serializers.js
CHANGED
|
@@ -30,8 +30,7 @@ function getTiming(obj) {
|
|
|
30
30
|
connect: timing.connect ?? -1,
|
|
31
31
|
headers: timing.headers ?? -1,
|
|
32
32
|
data: timing.data ?? -1,
|
|
33
|
-
|
|
34
|
-
error: timing.error ?? -1,
|
|
33
|
+
end: timing.end ?? timing.complete ?? timing.error ?? -1,
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
|