Skip to content

Commit

Permalink
Add server endpoint for top N hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcrail authored and rockdaboot committed May 4, 2022
1 parent 1f07192 commit 1016769
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/plugins/profiling/server/routes/register_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
*/
import type { IRouter } from '../../../../core/server';
import { DataRequestHandlerContext } from '../../../data/server';
import { registerTraceEventsTopNStackTracesSearchRoute } from './search_topNStackTraces';

import { registerFlameChartSearchRoute } from './search_flameChart';
import { registerTraceEventsTopNContainersSearchRoute } from './search_topNContainers';
import { registerTraceEventsTopNDeploymentsSearchRoute } from './search_topNDeployments';
import { registerTraceEventsTopNHostsSearchRoute } from './search_topNHosts';
import { registerTraceEventsTopNStackTracesSearchRoute } from './search_topNStackTraces';
import { registerTraceEventsTopNThreadsSearchRoute } from './search_topNThreads';
import { registerFlameChartSearchRoute } from './search_flameChart';

export function registerRoutes(router: IRouter<DataRequestHandlerContext>) {
registerTraceEventsTopNStackTracesSearchRoute(router);
registerFlameChartSearchRoute(router);
registerTraceEventsTopNContainersSearchRoute(router);
registerTraceEventsTopNDeploymentsSearchRoute(router);
registerTraceEventsTopNHostsSearchRoute(router);
registerTraceEventsTopNStackTracesSearchRoute(router);
registerTraceEventsTopNThreadsSearchRoute(router);
registerFlameChartSearchRoute(router);
}
18 changes: 18 additions & 0 deletions src/plugins/profiling/server/routes/search_topNHosts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import type { DataRequestHandlerContext } from '../../../data/server';
import type { IRouter } from '../../../../core/server';
import { getRemoteRoutePaths } from '../../common';
import { queryTopNCommon } from "./search_topN";

export function registerTraceEventsTopNHostsSearchRoute(
router: IRouter<DataRequestHandlerContext>
) {
const paths = getRemoteRoutePaths();
return queryTopNCommon(router, paths.TopNHosts, 'HostName');
}

0 comments on commit 1016769

Please sign in to comment.