Skip to content

Commit 4876de4

Browse files
committed
fix metrics
1 parent 3d9e388 commit 4876de4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/http-client/http-client-template.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as http from 'node:http';
22
import * as https from 'node:https';
3-
import { performance } from 'perf_hooks';
43
import { CounterType, HistogramType } from '@monkee/small-standards';
54
import type {
65
AxiosInstance,
@@ -42,12 +41,14 @@ export class HttpClientTemplate {
4241
async request<T = any>(
4342
config: HttpClientRequestConfig,
4443
): Promise<AxiosResponse<T>> {
45-
const start = performance.now();
44+
const start = Date.now();
4645

4746
try {
4847
const response = await this.httpClient.request<T>(config);
4948

50-
this.requestTime?.observe(performance.now() - start, {
49+
const end = Date.now();
50+
51+
this.requestTime?.observe(end - start / 1000, {
5152
id: this.id,
5253
method: config.method?.toUpperCase() ?? 'unknown',
5354
uri: config.url ?? 'unknown',

0 commit comments

Comments
 (0)