Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x-pack/dev-tools/api_debug/apis/kibana_stats/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/

export const name = 'kibana_stats';
export const description = 'Get the Kibana usage stats from the Kibana server';
export const description = 'Get the extended Kibana usage stats from the Kibana server';
export const method = 'GET';
export const path = '/api/_kibana/v1/stats';
export const path = '/api/stats?extended=true';
4 changes: 0 additions & 4 deletions x-pack/plugins/xpack_main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { replaceInjectedVars } from './server/lib/replace_injected_vars';
import { setupXPackMain } from './server/lib/setup_xpack_main';
import {
xpackInfoRoute,
xpackUsageRoute,
kibanaStatsRoute,
telemetryRoute,
} from './server/routes/api/v1';
import {
Expand Down Expand Up @@ -111,8 +109,6 @@ export const xpackMain = (kibana) => {

// register routes
xpackInfoRoute(server);
xpackUsageRoute(server); // To replace kibanaStatsRoute
kibanaStatsRoute(server); // Only used internally. Remove in the next major.
telemetryRoute(server);
}
});
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/xpack_main/server/routes/api/v1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
*/

export { xpackInfoRoute } from './xpack_info';
export { kibanaStatsRoute } from './kibana_stats';
export { xpackUsageRoute } from './xpack_usage';
export { telemetryRoute } from './telemetry';
47 changes: 0 additions & 47 deletions x-pack/plugins/xpack_main/server/routes/api/v1/kibana_stats.js

This file was deleted.

1 change: 0 additions & 1 deletion x-pack/test/api_integration/apis/xpack_main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
export default function ({ loadTestFile }) {
describe('xpack_main', () => {
loadTestFile(require.resolve('./telemetry'));
loadTestFile(require.resolve('./usage'));
});
}
12 changes: 0 additions & 12 deletions x-pack/test/api_integration/apis/xpack_main/usage/index.js

This file was deleted.

39 changes: 0 additions & 39 deletions x-pack/test/api_integration/apis/xpack_main/usage/usage.js

This file was deleted.

16 changes: 4 additions & 12 deletions x-pack/test/api_integration/services/usage_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,18 @@ export function UsageAPIProvider({ getService }) {
return {
async getUsageStatsNoAuth() {
const { body } = await supertestNoAuth
.get('/api/_xpack/usage')
.get('/api/stats?extended=true')
.set('kbn-xsrf', 'xxx')
.expect(401);
return body;
return body.usage;
},

async getUsageStats() {
const { body } = await supertest
.get('/api/_xpack/usage')
.get('/api/stats?extended=true')
.set('kbn-xsrf', 'xxx')
.expect(200);
return body;
},

async getUsageStatsFromDeprecatedPre64Endpoint() {
const { body } = await supertest
.get('/api/_kibana/v1/stats')
.set('kbn-xsrf', 'xxx')
.expect(200);
return body;
return body.usage;
},
};
}
24 changes: 0 additions & 24 deletions x-pack/test/reporting/api/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,5 @@ export default function ({ getService }) {
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 23);
});
});

/* Have to skip this test because the usage stats returned by the legacy
* endpoint aren't snake_cased in the legacy usage api. This will be
* completely removed in the next PR, when the legacy endpoint is removed
*/
describe.skip('deprecated API', () => {
it('shows correct stats', async () => {
const usage = await usageAPI.getUsageStatsFromDeprecatedPre64Endpoint();

reportingAPI.expectRecentPdfAppStats(usage, 'visualization', 2);
reportingAPI.expectRecentPdfAppStats(usage, 'dashboard', 2);
reportingAPI.expectRecentPdfLayoutStats(usage, 'preserve_layout', 2);
reportingAPI.expectRecentPdfLayoutStats(usage, 'print', 2);
reportingAPI.expectRecentJobTypeTotalStats(usage, 'csv', 1);
reportingAPI.expectRecentJobTypeTotalStats(usage, 'printable_pdf', 4);

reportingAPI.expectAllTimePdfAppStats(usage, 'visualization', 5);
reportingAPI.expectAllTimePdfAppStats(usage, 'dashboard', 5);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'preserve_layout', 5);
reportingAPI.expectAllTimePdfLayoutStats(usage, 'print', 5);
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'csv', 4);
reportingAPI.expectAllTimeJobTypeTotalStats(usage, 'printable_pdf', 23);
});
});
});
}