-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Profiling] Move additional flamegraph calculations into UI (#142415)
* Remove total and sampled traces from API * Remove Samples array from flamegraph API These values are redundant with CountInclusive so could be removed without issue. * Remove totalCount and eventsIndex These values are no longer needed. * Remove samples from callee tree * Refactor columnar view model into separate file * Add more lazy-loaded flamegraph calculations * Fix spacing in frame label * Remove frame information API * Improve test coverage * Fix type error * Replace fnv-plus with custom 64-bit FNV1-a * Add exceptions for linting errors * Add workaround for frame type truncation bug * Replace prior workaround for truncation bug This fix supercedes the prior workaround and addresses the truncation at its source. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
276cd3d
commit c888aca
Showing
22 changed files
with
531 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
x-pack/plugins/profiling/common/columnar_view_model.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { sum } from 'lodash'; | ||
import { createCalleeTree } from './callee'; | ||
import { createColumnarViewModel } from './columnar_view_model'; | ||
import { createBaseFlameGraph, createFlameGraph } from './flamegraph'; | ||
|
||
import { events, stackTraces, stackFrames, executables } from './__fixtures__/stacktraces'; | ||
|
||
const totalFrames = sum([...stackTraces.values()].map((trace) => trace.FrameIDs.length)); | ||
|
||
const tree = createCalleeTree(events, stackTraces, stackFrames, executables, totalFrames); | ||
const graph = createFlameGraph(createBaseFlameGraph(tree, 60)); | ||
|
||
describe('Columnar view model operations', () => { | ||
test('color values are generated by default', () => { | ||
const viewModel = createColumnarViewModel(graph); | ||
|
||
expect(sum(viewModel.color)).toBeGreaterThan(0); | ||
}); | ||
|
||
test('color values are not generated when disabled', () => { | ||
const viewModel = createColumnarViewModel(graph, false); | ||
|
||
expect(sum(viewModel.color)).toEqual(0); | ||
}); | ||
}); |
Oops, something went wrong.