Skip to content

Commit

Permalink
[7.x] [Enterprise Search] Rename "telemetry" to "stats" (#78124) (#78160
Browse files Browse the repository at this point in the history
)
  • Loading branch information
afharo authored Sep 22, 2020
1 parent 949cb6a commit 4d11537
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Shared Telemetry Helpers', () => {
metric: 'setup_guide',
});

expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/telemetry', {
expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/stats', {
headers,
body: '{"product":"enterprise_search","action":"viewed","metric":"setup_guide"}',
});
Expand All @@ -54,7 +54,7 @@ describe('Shared Telemetry Helpers', () => {
http: httpMock,
});

expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/telemetry', {
expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/stats', {
headers,
body: '{"product":"enterprise_search","action":"viewed","metric":"page"}',
});
Expand All @@ -65,7 +65,7 @@ describe('Shared Telemetry Helpers', () => {
http: httpMock,
});

expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/telemetry', {
expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/stats', {
headers,
body: '{"product":"app_search","action":"clicked","metric":"button"}',
});
Expand All @@ -76,7 +76,7 @@ describe('Shared Telemetry Helpers', () => {
http: httpMock,
});

expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/telemetry', {
expect(httpMock.put).toHaveBeenCalledWith('/api/enterprise_search/stats', {
headers,
body: '{"product":"workplace_search","action":"error","metric":"not_found"}',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ISendTelemetry extends ISendTelemetryProps {
export const sendTelemetry = async ({ http, product, action, metric }: ISendTelemetry) => {
try {
const body = JSON.stringify({ product, action, metric });
await http.put('/api/enterprise_search/telemetry', { headers, body });
await http.put('/api/enterprise_search/stats', { headers, body });
} catch (error) {
throw new Error('Unable to send telemetry');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Enterprise Search Telemetry API', () => {
});
});

describe('PUT /api/enterprise_search/telemetry', () => {
describe('PUT /api/enterprise_search/stats', () => {
it('increments the saved objects counter for App Search', async () => {
(incrementUICounter as jest.Mock).mockImplementation(jest.fn(() => successResponse));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function registerTelemetryRoute({
}: IRouteDependencies) {
router.put(
{
path: '/api/enterprise_search/telemetry',
path: '/api/enterprise_search/stats',
validate: {
body: schema.object({
product: schema.oneOf([
Expand Down

0 comments on commit 4d11537

Please sign in to comment.