We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d9e388 commit 4876de4Copy full SHA for 4876de4
src/http-client/http-client-template.ts
@@ -1,6 +1,5 @@
1
import * as http from 'node:http';
2
import * as https from 'node:https';
3
-import { performance } from 'perf_hooks';
4
import { CounterType, HistogramType } from '@monkee/small-standards';
5
import type {
6
AxiosInstance,
@@ -42,12 +41,14 @@ export class HttpClientTemplate {
42
41
async request<T = any>(
43
config: HttpClientRequestConfig,
44
): Promise<AxiosResponse<T>> {
45
- const start = performance.now();
+ const start = Date.now();
46
47
try {
48
const response = await this.httpClient.request<T>(config);
49
50
- this.requestTime?.observe(performance.now() - start, {
+ const end = Date.now();
+
51
+ this.requestTime?.observe(end - start / 1000, {
52
id: this.id,
53
method: config.method?.toUpperCase() ?? 'unknown',
54
uri: config.url ?? 'unknown',
0 commit comments