Skip to content

Commit 982ca27

Browse files
Copilotd-gubert
andcommitted
rename summary/histogram params to endpointTimeSummary/endpointTimeHistogram in metricsMiddleware
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
1 parent 6cee815 commit 982ca27

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

apps/meteor/app/api/server/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ export const startRestAPI = () => {
107107
basePathRegex: new RegExp(/^\/api\/v1\//),
108108
api: API.v1,
109109
settings,
110-
summary: metrics.rocketchatRestApi,
111-
histogram: metrics.rocketchatRestApiSeconds,
110+
endpointTimeSummary: metrics.rocketchatRestApi,
111+
endpointTimeHistogram: metrics.rocketchatRestApiSeconds,
112112
responseSizeHistogram: metrics.rocketchatRestApiResponseSizeBytes,
113113
activeRequestsGauge: metrics.rocketchatRestApiActiveRequests,
114114
}),

apps/meteor/app/api/server/middlewares/metrics.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ describe('Metrics middleware', () => {
3434
metricsMiddleware({
3535
api: { version: 1 } as any,
3636
settings,
37-
summary: summary as any,
38-
histogram: histogram as any,
37+
endpointTimeSummary: summary as any,
38+
endpointTimeHistogram: histogram as any,
3939
responseSizeHistogram: responseSizeHistogram as any,
4040
activeRequestsGauge: activeRequestsGauge as any,
4141
}),
@@ -98,8 +98,8 @@ describe('Metrics middleware', () => {
9898
basePathRegex: new RegExp(/^\/api\//),
9999
api: { version: 1 } as any,
100100
settings,
101-
summary: summary as any,
102-
histogram: histogram as any,
101+
endpointTimeSummary: summary as any,
102+
endpointTimeHistogram: histogram as any,
103103
responseSizeHistogram: responseSizeHistogram as any,
104104
activeRequestsGauge: activeRequestsGauge as any,
105105
}),
@@ -159,8 +159,8 @@ describe('Metrics middleware', () => {
159159
basePathRegex: new RegExp(/^\/api\//),
160160
api: { version: 1 } as any,
161161
settings,
162-
summary: summary as any,
163-
histogram: histogram as any,
162+
endpointTimeSummary: summary as any,
163+
endpointTimeHistogram: histogram as any,
164164
responseSizeHistogram: responseSizeHistogram as any,
165165
activeRequestsGauge: activeRequestsGauge as any,
166166
}),

apps/meteor/app/api/server/middlewares/metrics.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ export const metricsMiddleware =
99
basePathRegex,
1010
api,
1111
settings,
12-
summary,
13-
histogram,
12+
endpointTimeSummary,
13+
endpointTimeHistogram,
1414
responseSizeHistogram,
1515
activeRequestsGauge,
1616
}: {
1717
basePathRegex?: RegExp;
1818
api: APIClass;
1919
settings: CachedSettings;
20-
summary: Summary;
21-
histogram: Histogram;
20+
endpointTimeSummary: Summary;
21+
endpointTimeHistogram: Histogram;
2222
responseSizeHistogram: Histogram;
2323
activeRequestsGauge: Gauge;
2424
}): MiddlewareHandler =>
2525
async (c, next) => {
26-
const rocketchatRestApiEnd = summary.startTimer();
27-
const rocketchatRestApiHistEnd = histogram.startTimer();
26+
const rocketchatRestApiEnd = endpointTimeSummary.startTimer();
27+
const rocketchatRestApiHistEnd = endpointTimeHistogram.startTimer();
2828

2929
const methodLabel = { method: c.req.method.toLowerCase() };
3030
activeRequestsGauge.inc(methodLabel);

apps/meteor/app/integrations/server/api/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ Api.router
432432
basePathRegex: new RegExp(/^\/hooks\//),
433433
api: Api,
434434
settings,
435-
summary: metrics.rocketchatRestApi,
436-
histogram: metrics.rocketchatRestApiSeconds,
435+
endpointTimeSummary: metrics.rocketchatRestApi,
436+
endpointTimeHistogram: metrics.rocketchatRestApiSeconds,
437437
responseSizeHistogram: metrics.rocketchatRestApiResponseSizeBytes,
438438
activeRequestsGauge: metrics.rocketchatRestApiActiveRequests,
439439
}),

apps/meteor/ee/server/apps/communication/rest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export class AppsRestApi {
7777
basePathRegex: new RegExp(/^\/api\/apps\//),
7878
api: this.api,
7979
settings,
80-
summary: metrics.rocketchatRestApi,
81-
histogram: metrics.rocketchatRestApiSeconds,
80+
endpointTimeSummary: metrics.rocketchatRestApi,
81+
endpointTimeHistogram: metrics.rocketchatRestApiSeconds,
8282
responseSizeHistogram: metrics.rocketchatRestApiResponseSizeBytes,
8383
activeRequestsGauge: metrics.rocketchatRestApiActiveRequests,
8484
}),

0 commit comments

Comments
 (0)