Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Profiling] Profiling data access plugin #165198

Merged
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ packages/kbn-plugin-helpers @elastic/kibana-operations
examples/portable_dashboards_example @elastic/kibana-presentation
examples/preboot_example @elastic/kibana-security @elastic/kibana-core
src/plugins/presentation_util @elastic/kibana-presentation
x-pack/plugins/profiling_data_access @elastic/profiling-ui
x-pack/plugins/profiling @elastic/profiling-ui
x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations
packages/kbn-react-field @elastic/kibana-data-discovery
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,10 @@ Elastic.
|Universal Profiling provides fleet-wide, whole-system, continuous profiling with zero instrumentation. Get a comprehensive understanding of what lines of code are consuming compute resources throughout your entire fleet by visualizing your data in Kibana using the flamegraph, stacktraces, and top functions views.
|{kib-repo}blob/{branch}/x-pack/plugins/profiling_data_access[profilingDataAccess]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/remote_clusters/README.md[remoteClusters]
|This plugin helps users manage their remote clusters, which enable cross-cluster search and cross-cluster replication.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@
"@kbn/portable-dashboards-example": "link:examples/portable_dashboards_example",
"@kbn/preboot-example-plugin": "link:examples/preboot_example",
"@kbn/presentation-util-plugin": "link:src/plugins/presentation_util",
"@kbn/profiling-data-access-plugin": "link:x-pack/plugins/profiling_data_access",
"@kbn/profiling-plugin": "link:x-pack/plugins/profiling",
"@kbn/random-sampling": "link:x-pack/packages/kbn-random-sampling",
"@kbn/react-field": "link:packages/kbn-react-field",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,8 @@
"@kbn/preboot-example-plugin/*": ["examples/preboot_example/*"],
"@kbn/presentation-util-plugin": ["src/plugins/presentation_util"],
"@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"],
"@kbn/profiling-data-access-plugin": ["x-pack/plugins/profiling_data_access"],
"@kbn/profiling-data-access-plugin/*": ["x-pack/plugins/profiling_data_access/*"],
"@kbn/profiling-plugin": ["x-pack/plugins/profiling"],
"@kbn/profiling-plugin/*": ["x-pack/plugins/profiling/*"],
"@kbn/random-sampling": ["x-pack/packages/kbn-random-sampling"],
Expand Down
22 changes: 0 additions & 22 deletions x-pack/plugins/profiling/common/base64.ts

This file was deleted.

12 changes: 7 additions & 5 deletions x-pack/plugins/profiling/common/columnar_view_model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@

import { sum } from 'lodash';

import { createCalleeTree } from './callee';
import { createCalleeTree } from '@kbn/profiling-data-access-plugin/common/callee';
import { createColumnarViewModel } from './columnar_view_model';
import { createBaseFlameGraph, createFlameGraph } from './flamegraph';
import { decodeStackTraceResponse } from './stack_traces';

import { stackTraceFixtures } from './__fixtures__/stacktraces';
import {
createBaseFlameGraph,
createFlameGraph,
} from '@kbn/profiling-data-access-plugin/common/flamegraph';
import { decodeStackTraceResponse } from '@kbn/profiling-data-access-plugin/common/stack_traces';
import { stackTraceFixtures } from '@kbn/profiling-data-access-plugin/common/__fixtures__/stacktraces';

describe('Columnar view model operations', () => {
stackTraceFixtures.forEach(({ response, seconds, upsampledBy }) => {
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/profiling/common/columnar_view_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/

import { ColumnarViewModel } from '@elastic/charts';

import { ElasticFlameGraph } from './flamegraph';
import { ElasticFlameGraph } from '@kbn/profiling-data-access-plugin/common/flamegraph';
import { frameTypeToRGB, rgbToRGBA } from './frame_type_colors';

function normalize(n: number, lower: number, upper: number): number {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/profiling/common/frame_type_colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { FrameType } from './profiling';
import { FrameType } from '@kbn/profiling-data-access-plugin/common/profiling';

/*
* Helper to calculate the color of a given block to be drawn. The desirable outcomes of this are:
Expand Down
6 changes: 2 additions & 4 deletions x-pack/plugins/profiling/common/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
*/

import { sum } from 'lodash';

import { createTopNFunctions } from './functions';
import { decodeStackTraceResponse } from './stack_traces';

import { stackTraceFixtures } from './__fixtures__/stacktraces';
import { decodeStackTraceResponse } from '@kbn/profiling-data-access-plugin/common/stack_traces';
import { stackTraceFixtures } from '@kbn/profiling-data-access-plugin/common/__fixtures__/stacktraces';

describe('TopN function operations', () => {
stackTraceFixtures.forEach(({ response, seconds, upsampledBy }) => {
Expand Down
7 changes: 5 additions & 2 deletions x-pack/plugins/profiling/common/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
*/
import * as t from 'io-ts';
import { sumBy } from 'lodash';
import { createFrameGroupID, FrameGroupID } from './frame_group';
import {
createFrameGroupID,
FrameGroupID,
} from '@kbn/profiling-data-access-plugin/common/frame_group';
import {
createStackFrameMetadata,
emptyExecutable,
Expand All @@ -19,7 +22,7 @@ import {
StackFrameMetadata,
StackTrace,
StackTraceID,
} from './profiling';
} from '@kbn/profiling-data-access-plugin/common/profiling';

interface TopNFunctionAndFrameGroup {
Frame: StackFrameMetadata;
Expand Down
12 changes: 0 additions & 12 deletions x-pack/plugins/profiling/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ export function timeRangeFromRequest(request: any): [number, number] {
return [timeFrom, timeTo];
}

// Converts from a Map object to a Record object since Map objects are not
// serializable to JSON by default
export function fromMapToRecord<K extends string, V>(m: Map<K, V>): Record<string, V> {
const output: Record<string, V> = {};

for (const [key, value] of m) {
output[key] = value;
}

return output;
}

export const NOT_AVAILABLE_LABEL = i18n.translate('xpack.profiling.notAvailableLabel', {
defaultMessage: 'N/A',
});
170 changes: 0 additions & 170 deletions x-pack/plugins/profiling/common/run_length_encoding.test.ts

This file was deleted.

Loading