Change client metrics api path to client_perf (#26985)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6c674c7331
Коммит
f0121d4f23
@@ -49,7 +49,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
const report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
start: performance.timeOrigin + testMarkA.startTime,
|
||||
@@ -99,7 +99,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
const report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
counters: [
|
||||
@@ -151,7 +151,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
const report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
counters: [
|
||||
@@ -179,7 +179,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
let report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
histograms: [
|
||||
@@ -206,7 +206,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
histograms: [
|
||||
@@ -302,7 +302,7 @@ describe('PerformanceReporter', () => {
|
||||
await waitForReport();
|
||||
|
||||
expect(sendBeacon).toHaveBeenCalled();
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/perf');
|
||||
expect(sendBeacon.mock.calls[0][0]).toEqual(siteUrl + '/api/v4/client_perf');
|
||||
const report = JSON.parse(sendBeacon.mock.calls[0][1]);
|
||||
expect(report).toMatchObject({
|
||||
labels: {
|
||||
@@ -322,7 +322,7 @@ describe('PerformanceReporter', () => {
|
||||
|
||||
sendBeacon.mockReturnValue(false);
|
||||
const mock = nock(client.getBaseRoute()).
|
||||
post('/perf').
|
||||
post('/client_perf').
|
||||
reply(200);
|
||||
|
||||
expect(sendBeacon).not.toHaveBeenCalled();
|
||||
|
||||
@@ -492,7 +492,7 @@ export default class Client4 {
|
||||
}
|
||||
|
||||
getClientMetricsRoute() {
|
||||
return `${this.getBaseRoute()}/perf`;
|
||||
return `${this.getBaseRoute()}/client_perf`;
|
||||
}
|
||||
|
||||
getCSRFFromCookie() {
|
||||
|
||||
Ссылка в новой задаче
Block a user