@kylincloud/flamegraph 0.35.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1211 -0
- package/LICENSE +202 -0
- package/README.md +251 -0
- package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts +2 -0
- package/dist/FlameGraph/FlameGraphComponent/CheckIcon.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts +17 -0
- package/dist/FlameGraph/FlameGraphComponent/ContextMenu.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts +14 -0
- package/dist/FlameGraph/FlameGraphComponent/ContextMenuHighlight.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts +9 -0
- package/dist/FlameGraph/FlameGraphComponent/DiffLegend.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts +8 -0
- package/dist/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts +96 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts +27 -0
- package/dist/FlameGraph/FlameGraphComponent/Flamegraph_render.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts +7 -0
- package/dist/FlameGraph/FlameGraphComponent/GraphVizPane.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/Header.d.ts +12 -0
- package/dist/FlameGraph/FlameGraphComponent/Header.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts +18 -0
- package/dist/FlameGraph/FlameGraphComponent/Highlight.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts +2 -0
- package/dist/FlameGraph/FlameGraphComponent/LogoLink.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/color.d.ts +20 -0
- package/dist/FlameGraph/FlameGraphComponent/color.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts +11 -0
- package/dist/FlameGraph/FlameGraphComponent/colorPalette.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/constants.d.ts +6 -0
- package/dist/FlameGraph/FlameGraphComponent/constants.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/index.d.ts +37 -0
- package/dist/FlameGraph/FlameGraphComponent/index.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts +2 -0
- package/dist/FlameGraph/FlameGraphComponent/murmur3.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/testData.d.ts +53 -0
- package/dist/FlameGraph/FlameGraphComponent/testData.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/utils.d.ts +6 -0
- package/dist/FlameGraph/FlameGraphComponent/utils.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts +2 -0
- package/dist/FlameGraph/FlameGraphComponent/viewTypes.d.ts.map +1 -0
- package/dist/FlameGraph/FlameGraphRenderer.d.ts +86 -0
- package/dist/FlameGraph/FlameGraphRenderer.d.ts.map +1 -0
- package/dist/FlameGraph/decode.d.ts +27 -0
- package/dist/FlameGraph/decode.d.ts.map +1 -0
- package/dist/FlameGraph/normalize.d.ts +6 -0
- package/dist/FlameGraph/normalize.d.ts.map +1 -0
- package/dist/FlameGraph/uniqueness.d.ts +3 -0
- package/dist/FlameGraph/uniqueness.d.ts.map +1 -0
- package/dist/FlamegraphRenderer.d.ts +19 -0
- package/dist/FlamegraphRenderer.d.ts.map +1 -0
- package/dist/Icons.d.ts +9 -0
- package/dist/Icons.d.ts.map +1 -0
- package/dist/ProfilerTable.d.ts +21 -0
- package/dist/ProfilerTable.d.ts.map +1 -0
- package/dist/SharedQueryInput.d.ts +10 -0
- package/dist/SharedQueryInput.d.ts.map +1 -0
- package/dist/Toolbar.d.ts +31 -0
- package/dist/Toolbar.d.ts.map +1 -0
- package/dist/Tooltip/FlamegraphTooltip.d.ts +59 -0
- package/dist/Tooltip/FlamegraphTooltip.d.ts.map +1 -0
- package/dist/Tooltip/LeftClickIcon.d.ts +2 -0
- package/dist/Tooltip/LeftClickIcon.d.ts.map +1 -0
- package/dist/Tooltip/RightClickIcon.d.ts +2 -0
- package/dist/Tooltip/RightClickIcon.d.ts.map +1 -0
- package/dist/Tooltip/TableTooltip.d.ts +12 -0
- package/dist/Tooltip/TableTooltip.d.ts.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +29 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/convert/convertJaegerTraceToProfile.d.ts +3 -0
- package/dist/convert/convertJaegerTraceToProfile.d.ts.map +1 -0
- package/dist/convert/diffTwoProfiles.d.ts +3 -0
- package/dist/convert/diffTwoProfiles.d.ts.map +1 -0
- package/dist/convert/flamebearersToTree.d.ts +11 -0
- package/dist/convert/flamebearersToTree.d.ts.map +1 -0
- package/dist/convert/sandwichViewProfiles.d.ts +14 -0
- package/dist/convert/sandwichViewProfiles.d.ts.map +1 -0
- package/dist/convert/subtract.d.ts +3 -0
- package/dist/convert/subtract.d.ts.map +1 -0
- package/dist/convert/testData.d.ts +50 -0
- package/dist/convert/testData.d.ts.map +1 -0
- package/dist/convert/toGraphviz.d.ts +3 -0
- package/dist/convert/toGraphviz.d.ts.map +1 -0
- package/dist/fitMode/fitMode.d.ts +42 -0
- package/dist/fitMode/fitMode.d.ts.map +1 -0
- package/dist/format/format.d.ts +42 -0
- package/dist/format/format.d.ts.map +1 -0
- package/dist/i18n.d.ts +55 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.cjs.css +792 -0
- package/dist/index.cjs.js +5087 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.css +792 -0
- package/dist/index.esm.js +5079 -0
- package/dist/index.node.d.ts +9 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/logo-v3-small-T5VXIMRR.svg +32 -0
- package/dist/models/decode.d.ts +3 -0
- package/dist/models/decode.d.ts.map +1 -0
- package/dist/models/flamebearer.d.ts +63 -0
- package/dist/models/flamebearer.d.ts.map +1 -0
- package/dist/models/groups.d.ts +37 -0
- package/dist/models/groups.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/profile.d.ts +152 -0
- package/dist/models/profile.d.ts.map +1 -0
- package/dist/models/spyName.d.ts +8 -0
- package/dist/models/spyName.d.ts.map +1 -0
- package/dist/models/trace.d.ts +357 -0
- package/dist/models/trace.d.ts.map +1 -0
- package/dist/models/units.d.ts +6 -0
- package/dist/models/units.d.ts.map +1 -0
- package/dist/search.d.ts +2 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/shims/Box.d.ts +38 -0
- package/dist/shims/Box.d.ts.map +1 -0
- package/dist/shims/Button.d.ts +26 -0
- package/dist/shims/Button.d.ts.map +1 -0
- package/dist/shims/Dropdown.d.ts +30 -0
- package/dist/shims/Dropdown.d.ts.map +1 -0
- package/dist/shims/Input.d.ts +19 -0
- package/dist/shims/Input.d.ts.map +1 -0
- package/dist/shims/LoadingSpinner.d.ts +7 -0
- package/dist/shims/LoadingSpinner.d.ts.map +1 -0
- package/dist/shims/Menu.d.ts +4 -0
- package/dist/shims/Menu.d.ts.map +1 -0
- package/dist/shims/NoData.d.ts +2 -0
- package/dist/shims/NoData.d.ts.map +1 -0
- package/dist/shims/Table.d.ts +52 -0
- package/dist/shims/Table.d.ts.map +1 -0
- package/dist/shims/Tooltip.d.ts +9 -0
- package/dist/shims/Tooltip.d.ts.map +1 -0
- package/package.json +84 -0
- package/src/FlameGraph/FlameGraphComponent/CheckIcon.tsx +27 -0
- package/src/FlameGraph/FlameGraphComponent/ContextMenu.module.scss +10 -0
- package/src/FlameGraph/FlameGraphComponent/ContextMenu.spec.tsx +84 -0
- package/src/FlameGraph/FlameGraphComponent/ContextMenu.tsx +86 -0
- package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.module.css +8 -0
- package/src/FlameGraph/FlameGraphComponent/ContextMenuHighlight.tsx +47 -0
- package/src/FlameGraph/FlameGraphComponent/DiffLegend.module.css +21 -0
- package/src/FlameGraph/FlameGraphComponent/DiffLegend.tsx +52 -0
- package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.module.css +40 -0
- package/src/FlameGraph/FlameGraphComponent/DiffLegendPaletteDropdown.tsx +129 -0
- package/src/FlameGraph/FlameGraphComponent/Flamegraph.spec.ts +552 -0
- package/src/FlameGraph/FlameGraphComponent/Flamegraph.ts +446 -0
- package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.spec.tsx +233 -0
- package/src/FlameGraph/FlameGraphComponent/Flamegraph_render.ts +478 -0
- package/src/FlameGraph/FlameGraphComponent/GraphVizPane.tsx +56 -0
- package/src/FlameGraph/FlameGraphComponent/GraphVizPanel.module.scss +55 -0
- package/src/FlameGraph/FlameGraphComponent/Header.module.css +27 -0
- package/src/FlameGraph/FlameGraphComponent/Header.tsx +71 -0
- package/src/FlameGraph/FlameGraphComponent/Highlight.module.css +7 -0
- package/src/FlameGraph/FlameGraphComponent/Highlight.spec.tsx +53 -0
- package/src/FlameGraph/FlameGraphComponent/Highlight.tsx +94 -0
- package/src/FlameGraph/FlameGraphComponent/LogoLink.module.scss +10 -0
- package/src/FlameGraph/FlameGraphComponent/LogoLink.tsx +101 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-collapses-small-blocks-into-one-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-diff-mode-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-highlighted-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-normal-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/canvas-renderer-spec-tsx-canvas-renderer-group-snapshot-works-with-selected-node-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-also-zooms-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-in-the-beginning-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-when-node-is-not-in-the-beginning-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-focused-renders-a-focused-node-zoom-top-level-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-complex-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-double-diff-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-double-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-highlighted-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-simple-tree-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-flamegraph-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/__image_snapshots__/flamegraph-render-spec-tsx-render-group-snapshot-renders-a-zoomed-with-fit-mode-tail-1-snap.png +0 -0
- package/src/FlameGraph/FlameGraphComponent/canvas.module.css +6 -0
- package/src/FlameGraph/FlameGraphComponent/color.spec.ts +308 -0
- package/src/FlameGraph/FlameGraphComponent/color.ts +167 -0
- package/src/FlameGraph/FlameGraphComponent/colorPalette.ts +58 -0
- package/src/FlameGraph/FlameGraphComponent/constants.ts +5 -0
- package/src/FlameGraph/FlameGraphComponent/index.spec.tsx +291 -0
- package/src/FlameGraph/FlameGraphComponent/index.tsx +411 -0
- package/src/FlameGraph/FlameGraphComponent/murmur3.ts +97 -0
- package/src/FlameGraph/FlameGraphComponent/styles.module.scss +10 -0
- package/src/FlameGraph/FlameGraphComponent/testData.ts +427 -0
- package/src/FlameGraph/FlameGraphComponent/utils.ts +31 -0
- package/src/FlameGraph/FlameGraphComponent/viewTypes.ts +6 -0
- package/src/FlameGraph/FlameGraphRenderer.tsx +603 -0
- package/src/FlameGraph/FlamegraphRenderer.module.scss +93 -0
- package/src/FlameGraph/decode.ts +78 -0
- package/src/FlameGraph/normalize.spec.ts +76 -0
- package/src/FlameGraph/normalize.ts +60 -0
- package/src/FlameGraph/testData.json +423 -0
- package/src/FlameGraph/uniqueness.spec.ts +16 -0
- package/src/FlameGraph/uniqueness.ts +84 -0
- package/src/FlamegraphRenderer.tsx +61 -0
- package/src/Icons.tsx +74 -0
- package/src/ProfilerTable.tsx +527 -0
- package/src/SharedQueryInput.module.scss +82 -0
- package/src/SharedQueryInput.tsx +127 -0
- package/src/Toolbar.module.scss +117 -0
- package/src/Toolbar.spec.tsx +217 -0
- package/src/Toolbar.tsx +471 -0
- package/src/Tooltip/FlamegraphTooltip.spec.tsx +81 -0
- package/src/Tooltip/FlamegraphTooltip.tsx +257 -0
- package/src/Tooltip/LeftClickIcon.tsx +18 -0
- package/src/Tooltip/RightClickIcon.tsx +18 -0
- package/src/Tooltip/TableTooltip.spec.tsx +44 -0
- package/src/Tooltip/TableTooltip.tsx +145 -0
- package/src/Tooltip/Tooltip.module.scss +71 -0
- package/src/Tooltip/Tooltip.spec.tsx +395 -0
- package/src/Tooltip/Tooltip.tsx +336 -0
- package/src/__snapshots__/Toolbar.spec.tsx.snap +297 -0
- package/src/convert/convertJaegerTraceToProfile.ts +97 -0
- package/src/convert/diffTwoProfiles.ts +81 -0
- package/src/convert/flamebearersToTree.ts +78 -0
- package/src/convert/sandwichViewProfiles.spec.ts +65 -0
- package/src/convert/sandwichViewProfiles.ts +191 -0
- package/src/convert/subtract.ts +87 -0
- package/src/convert/testData.ts +145 -0
- package/src/convert/toGraphviz.ts +485 -0
- package/src/fitMode/fitMode.spec.ts +93 -0
- package/src/fitMode/fitMode.ts +122 -0
- package/src/format/format.spec.ts +291 -0
- package/src/format/format.ts +303 -0
- package/src/globals.d.ts +13 -0
- package/src/i18n.tsx +293 -0
- package/src/index.node.ts +19 -0
- package/src/index.spec.tsx +383 -0
- package/src/index.tsx +10 -0
- package/src/logo-v3-small.svg +32 -0
- package/src/models/decode.ts +45 -0
- package/src/models/flamebearer.ts +86 -0
- package/src/models/groups.ts +14 -0
- package/src/models/index.ts +7 -0
- package/src/models/profile.spec.ts +32 -0
- package/src/models/profile.ts +48 -0
- package/src/models/spyName.spec.ts +18 -0
- package/src/models/spyName.ts +32 -0
- package/src/models/trace.ts +45 -0
- package/src/models/units.spec.ts +21 -0
- package/src/models/units.ts +24 -0
- package/src/sass/_common.scss +206 -0
- package/src/sass/_css-variables.scss +201 -0
- package/src/sass/_mixins.scss +15 -0
- package/src/sass/_sanitize.scss +407 -0
- package/src/sass/_variables.scss +53 -0
- package/src/sass/flamegraph.scss +18 -0
- package/src/search.spec.ts +11 -0
- package/src/search.ts +4 -0
- package/src/shameful-any.d.ts +2 -0
- package/src/shims/Box.module.scss +57 -0
- package/src/shims/Box.tsx +105 -0
- package/src/shims/Button.module.scss +129 -0
- package/src/shims/Button.tsx +128 -0
- package/src/shims/Dropdown.module.scss +63 -0
- package/src/shims/Dropdown.tsx +96 -0
- package/src/shims/Input.module.scss +15 -0
- package/src/shims/Input.tsx +55 -0
- package/src/shims/LoadingSpinner.tsx +19 -0
- package/src/shims/Menu.tsx +9 -0
- package/src/shims/NoData.module.scss +6 -0
- package/src/shims/NoData.tsx +11 -0
- package/src/shims/Table.module.scss +82 -0
- package/src/shims/Table.spec.tsx +121 -0
- package/src/shims/Table.tsx +252 -0
- package/src/shims/Tooltip.tsx +51 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Profile } from '../models';
|
|
2
|
+
|
|
3
|
+
export function deltaDiffWrapperReverse(
|
|
4
|
+
format: Profile['metadata']['format'],
|
|
5
|
+
levels: Profile['flamebearer']['levels']
|
|
6
|
+
) {
|
|
7
|
+
const mutableLevels = [...levels];
|
|
8
|
+
|
|
9
|
+
function deltaDiff(
|
|
10
|
+
lvls: Profile['flamebearer']['levels'],
|
|
11
|
+
start: number,
|
|
12
|
+
step: number
|
|
13
|
+
) {
|
|
14
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
15
|
+
for (const level of lvls) {
|
|
16
|
+
let total = 0;
|
|
17
|
+
for (let i = start; i < level.length; i += step) {
|
|
18
|
+
level[i] -= total;
|
|
19
|
+
total += level[i] + level[i + 1];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (format === 'double') {
|
|
25
|
+
deltaDiff(mutableLevels, 0, 7);
|
|
26
|
+
deltaDiff(mutableLevels, 3, 7);
|
|
27
|
+
} else {
|
|
28
|
+
deltaDiff(mutableLevels, 0, 4);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return mutableLevels;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function deltaDiffWrapper(
|
|
35
|
+
format: Profile['metadata']['format'],
|
|
36
|
+
levels: Profile['flamebearer']['levels']
|
|
37
|
+
) {
|
|
38
|
+
const mutableLevels = [...levels];
|
|
39
|
+
|
|
40
|
+
function deltaDiff(
|
|
41
|
+
lvls: Profile['flamebearer']['levels'],
|
|
42
|
+
start: number,
|
|
43
|
+
step: number
|
|
44
|
+
) {
|
|
45
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
46
|
+
for (const level of lvls) {
|
|
47
|
+
let prev = 0;
|
|
48
|
+
for (let i = start; i < level.length; i += step) {
|
|
49
|
+
level[i] += prev;
|
|
50
|
+
prev = level[i] + level[i + 1];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (format === 'double') {
|
|
56
|
+
deltaDiff(mutableLevels, 0, 7);
|
|
57
|
+
deltaDiff(mutableLevels, 3, 7);
|
|
58
|
+
} else {
|
|
59
|
+
deltaDiff(mutableLevels, 0, 4);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return mutableLevels;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/*
|
|
66
|
+
* decodeLevels decodes an unecoded
|
|
67
|
+
* It:
|
|
68
|
+
* - expects input data to be not decoded (ie. not idempotent)
|
|
69
|
+
* - mutates the 'flamebearer.levels' field in place
|
|
70
|
+
*/
|
|
71
|
+
export function decodeFlamebearer(fb: Profile) {
|
|
72
|
+
fb.flamebearer.levels = deltaDiffWrapper(
|
|
73
|
+
fb.metadata.format,
|
|
74
|
+
fb.flamebearer.levels
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return fb;
|
|
78
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { normalize } from './normalize';
|
|
2
|
+
import { Flamebearer, Profile } from '../models';
|
|
3
|
+
|
|
4
|
+
describe('normalize', () => {
|
|
5
|
+
it('accepts a flamebearer', () => {
|
|
6
|
+
const flame: Flamebearer = {
|
|
7
|
+
format: 'single',
|
|
8
|
+
names: ['foo'],
|
|
9
|
+
units: 'unknown',
|
|
10
|
+
levels: [[99]],
|
|
11
|
+
spyName: 'unknown',
|
|
12
|
+
numTicks: 10,
|
|
13
|
+
sampleRate: 100,
|
|
14
|
+
maxSelf: 1,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
expect(normalize({ flamebearer: flame })).toStrictEqual(flame);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('accepts a profile', () => {
|
|
21
|
+
const input: { profile: Profile } = {
|
|
22
|
+
profile: {
|
|
23
|
+
metadata: {
|
|
24
|
+
spyName: 'unknown',
|
|
25
|
+
format: 'single',
|
|
26
|
+
sampleRate: 100,
|
|
27
|
+
units: 'unknown',
|
|
28
|
+
},
|
|
29
|
+
flamebearer: {
|
|
30
|
+
levels: [
|
|
31
|
+
[0, 609, 0, 0],
|
|
32
|
+
[0, 606, 0, 13, 0, 3, 0, 1],
|
|
33
|
+
],
|
|
34
|
+
maxSelf: 1,
|
|
35
|
+
names: ['total', 'foo'],
|
|
36
|
+
numTicks: 10,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const snapshot = JSON.parse(JSON.stringify(input));
|
|
41
|
+
|
|
42
|
+
const flame = normalize(input);
|
|
43
|
+
|
|
44
|
+
expect(flame).toStrictEqual({
|
|
45
|
+
format: 'single',
|
|
46
|
+
names: ['total', 'foo'],
|
|
47
|
+
units: 'unknown',
|
|
48
|
+
levels: [
|
|
49
|
+
[0, 609, 0, 0],
|
|
50
|
+
[0, 606, 0, 13, 606, 3, 0, 1],
|
|
51
|
+
],
|
|
52
|
+
spyName: 'unknown',
|
|
53
|
+
numTicks: 10,
|
|
54
|
+
sampleRate: 100,
|
|
55
|
+
maxSelf: 1,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// It should not modify the original object
|
|
59
|
+
// Since it's stored in the redux store
|
|
60
|
+
expect(input).toStrictEqual(snapshot);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('accepts nothing', () => {
|
|
64
|
+
const flame = normalize({});
|
|
65
|
+
expect(flame).toStrictEqual({
|
|
66
|
+
format: 'single',
|
|
67
|
+
names: [],
|
|
68
|
+
units: 'unknown',
|
|
69
|
+
levels: [[]],
|
|
70
|
+
spyName: 'unknown',
|
|
71
|
+
numTicks: 0,
|
|
72
|
+
sampleRate: 0,
|
|
73
|
+
maxSelf: 0,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Flamebearer, Profile } from '../models';
|
|
2
|
+
import { decodeFlamebearer } from './decode';
|
|
3
|
+
|
|
4
|
+
// normalize receives either a Profile or a Flamebearer
|
|
5
|
+
// then generates an usable 'Flamebearer', the expected format downstream
|
|
6
|
+
export function normalize(p: {
|
|
7
|
+
profile?: Profile;
|
|
8
|
+
flamebearer?: Flamebearer;
|
|
9
|
+
}): Flamebearer {
|
|
10
|
+
if (p.profile && p.flamebearer) {
|
|
11
|
+
console.warn(
|
|
12
|
+
"'profile' and 'flamebearer' properties are mutually exclusive. Please use profile if possible."
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (p.profile) {
|
|
17
|
+
const copy = {
|
|
18
|
+
...p.profile,
|
|
19
|
+
flamebearer: { ...p.profile.flamebearer },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// TODO: copy levels, since that's modified by decode
|
|
23
|
+
copy.flamebearer.levels = JSON.parse(
|
|
24
|
+
JSON.stringify(copy.flamebearer.levels)
|
|
25
|
+
);
|
|
26
|
+
decodeFlamebearer(copy);
|
|
27
|
+
|
|
28
|
+
const p2 = {
|
|
29
|
+
...copy,
|
|
30
|
+
...copy.metadata,
|
|
31
|
+
...copy.flamebearer,
|
|
32
|
+
|
|
33
|
+
// We won't need these fields again
|
|
34
|
+
flamebearer: undefined,
|
|
35
|
+
metadata: undefined,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
delete p2.flamebearer;
|
|
39
|
+
delete p2.metadata;
|
|
40
|
+
return p2 as Flamebearer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (p.flamebearer) {
|
|
44
|
+
return p.flamebearer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// people may send us both values as undefined
|
|
48
|
+
// but we still have to render something
|
|
49
|
+
const noop: Flamebearer = {
|
|
50
|
+
format: 'single',
|
|
51
|
+
names: [],
|
|
52
|
+
units: 'unknown',
|
|
53
|
+
levels: [[]],
|
|
54
|
+
spyName: 'unknown',
|
|
55
|
+
numTicks: 0,
|
|
56
|
+
sampleRate: 0,
|
|
57
|
+
maxSelf: 0,
|
|
58
|
+
};
|
|
59
|
+
return noop;
|
|
60
|
+
}
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"flamebearer": {
|
|
4
|
+
"names": [
|
|
5
|
+
"total",
|
|
6
|
+
"runtime/pprof.profileWriter",
|
|
7
|
+
"runtime/pprof.(*profileBuilder).build",
|
|
8
|
+
"runtime/pprof.(*protobuf).strings",
|
|
9
|
+
"runtime/pprof.(*protobuf).string",
|
|
10
|
+
"runtime/pprof.(*profileBuilder).appendLocsForStack",
|
|
11
|
+
"runtime/pprof.allFrames",
|
|
12
|
+
"runtime/pprof.(*profileBuilder).emitLocation",
|
|
13
|
+
"runtime/pprof.(*protobuf).uint64Opt",
|
|
14
|
+
"runtime/pprof.(*protobuf).uint64",
|
|
15
|
+
"runtime/pprof.(*protobuf).varint",
|
|
16
|
+
"compress/gzip.(*Writer).Write",
|
|
17
|
+
"compress/flate.NewWriter",
|
|
18
|
+
"compress/flate.(*compressor).init",
|
|
19
|
+
"compress/flate.newHuffmanBitWriter",
|
|
20
|
+
"compress/flate.newHuffmanEncoder",
|
|
21
|
+
"compress/flate.newDeflateFast",
|
|
22
|
+
"runtime/pprof.(*profileBuilder).addCPUData",
|
|
23
|
+
"runtime/pprof.(*profMap).lookup",
|
|
24
|
+
"net/http.(*conn).serve",
|
|
25
|
+
"net/http.serverHandler.ServeHTTP",
|
|
26
|
+
"github.com/gorilla/handlers.loggingHandler.ServeHTTP",
|
|
27
|
+
"net/http.HandlerFunc.ServeHTTP",
|
|
28
|
+
"github.com/klauspost/compress/gzhttp.NewWrapper.func1.1",
|
|
29
|
+
"github.com/klauspost/compress/gzhttp.NewWrapper.func1.1.1",
|
|
30
|
+
"github.com/klauspost/compress/gzhttp.(*GzipResponseWriter).Close",
|
|
31
|
+
"github.com/klauspost/compress/gzhttp/writer/gzkp.(*pooledWriter).Close",
|
|
32
|
+
"github.com/klauspost/compress/gzip.(*Writer).Close",
|
|
33
|
+
"github.com/klauspost/compress/flate.(*Writer).Close",
|
|
34
|
+
"github.com/klauspost/compress/flate.(*compressor).close",
|
|
35
|
+
"github.com/klauspost/compress/flate.(*compressor).storeFast",
|
|
36
|
+
"github.com/klauspost/compress/flate.(*fastEncL1).Encode",
|
|
37
|
+
"github.com/klauspost/compress/flate.(*fastGen).addBlock",
|
|
38
|
+
"github.com/gorilla/mux.(*Router).ServeHTTP",
|
|
39
|
+
"github.com/johejo/go-content-encoding.Decode.func1.1",
|
|
40
|
+
"github.com/slok/go-http-metrics/middleware/std.Handler.func1",
|
|
41
|
+
"github.com/slok/go-http-metrics/middleware.Middleware.Measure",
|
|
42
|
+
"github.com/slok/go-http-metrics/middleware/std.Handler.func1.1",
|
|
43
|
+
"github.com/pyroscope-io/pyroscope/pkg/server.(*Controller).drainMiddleware.func1",
|
|
44
|
+
"github.com/pyroscope-io/pyroscope/pkg/server.(*RenderHandler).ServeHTTP",
|
|
45
|
+
"github.com/pyroscope-io/pyroscope/pkg/structs/flamebearer.NewProfile",
|
|
46
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).FlamebearerStruct",
|
|
47
|
+
"github.com/pyroscope-io/pyroscope/pkg/server/httputils.(*DefaultImpl).WriteResponseJSON",
|
|
48
|
+
"encoding/json.(*Encoder).Encode",
|
|
49
|
+
"github.com/slok/go-http-metrics/middleware/std.(*responseWriterInterceptor).Write",
|
|
50
|
+
"github.com/klauspost/compress/gzhttp.(*GzipResponseWriter).Write",
|
|
51
|
+
"github.com/klauspost/compress/gzhttp.(*GzipResponseWriter).startGzip",
|
|
52
|
+
"github.com/klauspost/compress/gzip.(*Writer).Write",
|
|
53
|
+
"github.com/klauspost/compress/flate.NewWriter",
|
|
54
|
+
"github.com/klauspost/compress/flate.(*compressor).init",
|
|
55
|
+
"github.com/klauspost/compress/flate.newHuffmanBitWriter",
|
|
56
|
+
"github.com/klauspost/compress/flate.newHuffmanEncoder",
|
|
57
|
+
"net/http.(*fileHandler).ServeHTTP",
|
|
58
|
+
"net/http.serveFile",
|
|
59
|
+
"net/http.serveContent",
|
|
60
|
+
"io.CopyN",
|
|
61
|
+
"io.Copy",
|
|
62
|
+
"io.copyBuffer",
|
|
63
|
+
"github.com/klauspost/compress/flate.(*Writer).Write",
|
|
64
|
+
"github.com/klauspost/compress/flate.(*compressor).write",
|
|
65
|
+
"github.com/klauspost/compress/flate.(*huffmanBitWriter).writeBlockHuff",
|
|
66
|
+
"github.com/felixge/httpsnoop.(*rw).Write",
|
|
67
|
+
"github.com/gorilla/handlers.makeLogger.func1",
|
|
68
|
+
"github.com/klauspost/compress/flate.(*huffmanBitWriter).writeBlockDynamic",
|
|
69
|
+
"github.com/klauspost/compress/flate.(*huffmanBitWriter).writeTokens",
|
|
70
|
+
"github.com/klauspost/compress/flate.newFastEnc",
|
|
71
|
+
"github.com/gorilla/mux.(*Router).Match",
|
|
72
|
+
"github.com/gorilla/mux.(*Route).Match",
|
|
73
|
+
"github.com/gorilla/mux.(*routeRegexp).Match",
|
|
74
|
+
"regexp.(*Regexp).MatchString",
|
|
75
|
+
"regexp.(*Regexp).doMatch",
|
|
76
|
+
"regexp.(*Regexp).doExecute",
|
|
77
|
+
"regexp.(*Regexp).backtrack",
|
|
78
|
+
"regexp.(*bitState).reset",
|
|
79
|
+
"net/http.(*conn).readRequest",
|
|
80
|
+
"net/http.readRequest",
|
|
81
|
+
"net/textproto.(*Reader).ReadMIMEHeader",
|
|
82
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.New.func2",
|
|
83
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).saveToDisk",
|
|
84
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.treeCodec.Serialize",
|
|
85
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).SerializeTruncate",
|
|
86
|
+
"github.com/valyala/bytebufferpool.(*ByteBuffer).Write",
|
|
87
|
+
"github.com/pyroscope-io/pyroscope/pkg/util/varint.Writer.Write",
|
|
88
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).minValue",
|
|
89
|
+
"github.com/pyroscope-io/pyroscope/pkg/structs/cappedarr.New",
|
|
90
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).iterateWithTotal",
|
|
91
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/dict.(*Dict).PutValue",
|
|
92
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.segmentCodec.Serialize",
|
|
93
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Segment).Serialize",
|
|
94
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Segment).generateMetadata",
|
|
95
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.dictionaryCodec.Serialize",
|
|
96
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/dict.(*Dict).Serialize",
|
|
97
|
+
"github.com/pyroscope-io/pyroscope/pkg/util/varint.Write",
|
|
98
|
+
"github.com/dgraph-io/badger/v2.(*DB).Update",
|
|
99
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).saveToDisk.func1",
|
|
100
|
+
"github.com/dgraph-io/badger/v2.(*Txn).Set",
|
|
101
|
+
"github.com/dgraph-io/badger/v2.(*Txn).SetEntry",
|
|
102
|
+
"github.com/dgraph-io/badger/v2.(*Txn).modify",
|
|
103
|
+
"github.com/dgraph-io/badger/v2.(*DB).NewTransaction",
|
|
104
|
+
"github.com/dgraph-io/badger/v2.(*DB).newTransaction",
|
|
105
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.(*Storage).Put",
|
|
106
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Segment).Put",
|
|
107
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*streeNode).put",
|
|
108
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Segment).Put.func1",
|
|
109
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.(*Storage).Put.func1",
|
|
110
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).Clone",
|
|
111
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*treeNode).clone",
|
|
112
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.(*IngestionQueue).runQueueWorker",
|
|
113
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage.(*IngestionQueue).safePut",
|
|
114
|
+
"github.com/sirupsen/logrus.(*Entry).Debug",
|
|
115
|
+
"github.com/sirupsen/logrus.(*Entry).Log",
|
|
116
|
+
"github.com/sirupsen/logrus.(*Entry).log",
|
|
117
|
+
"github.com/sirupsen/logrus.(*Entry).write",
|
|
118
|
+
"github.com/sirupsen/logrus.(*TextFormatter).Format",
|
|
119
|
+
"github.com/sirupsen/logrus.(*TextFormatter).printColored",
|
|
120
|
+
"fmt.Sprint",
|
|
121
|
+
"fmt.newPrinter",
|
|
122
|
+
"sync.(*Pool).Get",
|
|
123
|
+
"fmt.glob..func1",
|
|
124
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*streeNode).overlapWrite",
|
|
125
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.overlapWrite",
|
|
126
|
+
"math/big.NewRat",
|
|
127
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).Merge",
|
|
128
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.prependTreeNode",
|
|
129
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*treeNode).insert",
|
|
130
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.newNode",
|
|
131
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Key).TreeKey",
|
|
132
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/segment.(*Key).Normalized",
|
|
133
|
+
"strings.(*Builder).WriteString",
|
|
134
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).GetOrCreate",
|
|
135
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).get",
|
|
136
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache/lfu.(*Cache).GetOrSet",
|
|
137
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).get.func1",
|
|
138
|
+
"github.com/dgraph-io/badger/v2.(*DB).View",
|
|
139
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/cache.(*Cache).get.func1.1",
|
|
140
|
+
"github.com/dgraph-io/badger/v2.(*Txn).Get",
|
|
141
|
+
"github.com/dgraph-io/badger/v2/y.KeyWithTs",
|
|
142
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/labels.(*Labels).PutLabels",
|
|
143
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/labels.(*Labels).PutLabels.func1",
|
|
144
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).takeSnapshots",
|
|
145
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).reset",
|
|
146
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).uploadData",
|
|
147
|
+
"runtime/pprof.(*Profile).WriteTo",
|
|
148
|
+
"runtime/pprof.writeGoroutine",
|
|
149
|
+
"runtime/pprof.writeRuntimeProfile",
|
|
150
|
+
"runtime/pprof.printCountProfile",
|
|
151
|
+
"runtime/pprof.printCountProfile.func1",
|
|
152
|
+
"fmt.Fprintf",
|
|
153
|
+
"bytes.(*Buffer).Write",
|
|
154
|
+
"bytes.(*Buffer).grow",
|
|
155
|
+
"bytes.growSlice",
|
|
156
|
+
"bytes.(*Buffer).String",
|
|
157
|
+
"github.com/pyroscope-io/pyroscope/pkg/selfprofiling.(*Upstream).Upload",
|
|
158
|
+
"github.com/pyroscope-io/pyroscope/pkg/parser.(*Parser).Ingest",
|
|
159
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*RawProfile).Parse",
|
|
160
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*Parser).ParsePprof",
|
|
161
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.DecodePool",
|
|
162
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.Decode",
|
|
163
|
+
"github.com/valyala/bytebufferpool.(*ByteBuffer).ReadFrom",
|
|
164
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Profile).UnmarshalVT",
|
|
165
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Sample).UnmarshalVT",
|
|
166
|
+
"compress/gzip.NewReader",
|
|
167
|
+
"compress/gzip.(*Reader).Reset",
|
|
168
|
+
"compress/gzip.(*Reader).readHeader",
|
|
169
|
+
"compress/flate.NewReader",
|
|
170
|
+
"compress/flate.(*dictDecoder).init",
|
|
171
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*Parser).ParsePprof.func1",
|
|
172
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*Parser).Convert",
|
|
173
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*Parser).iterate",
|
|
174
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*Parser).readTrees",
|
|
175
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Tree).InsertStack",
|
|
176
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).uploadData.func1",
|
|
177
|
+
"runtime/pprof.StartCPUProfile",
|
|
178
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).dumpMutexProfile",
|
|
179
|
+
"compress/gzip.(*Reader).Read",
|
|
180
|
+
"compress/flate.(*decompressor).Read",
|
|
181
|
+
"compress/flate.(*decompressor).nextBlock",
|
|
182
|
+
"compress/flate.(*decompressor).readHuffman",
|
|
183
|
+
"compress/flate.(*huffmanDecoder).init",
|
|
184
|
+
"github.com/pyroscope-io/godeltaprof.(*BlockProfiler).Profile",
|
|
185
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*DeltaMutexProfiler).PrintCountCycleProfile",
|
|
186
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).build",
|
|
187
|
+
"compress/gzip.(*Writer).Close",
|
|
188
|
+
"compress/flate.(*Writer).Close",
|
|
189
|
+
"compress/flate.(*compressor).close",
|
|
190
|
+
"compress/flate.(*compressor).encSpeed",
|
|
191
|
+
"compress/flate.(*huffmanBitWriter).writeBlockDynamic",
|
|
192
|
+
"compress/flate.(*huffmanEncoder).generate",
|
|
193
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).appendLocsForStack",
|
|
194
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.allFrames",
|
|
195
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).emitLocation",
|
|
196
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).stringIndex",
|
|
197
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).dumpHeapProfile",
|
|
198
|
+
"github.com/pyroscope-io/pyroscope/pkg/storage/tree.(*Location).UnmarshalVT",
|
|
199
|
+
"github.com/pyroscope-io/godeltaprof.(*HeapProfiler).Profile",
|
|
200
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*DeltaHeapProfiler).WriteHeapProto",
|
|
201
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*protobuf).strings",
|
|
202
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*protobuf).string",
|
|
203
|
+
"compress/flate.(*huffmanBitWriter).indexTokens",
|
|
204
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).flush",
|
|
205
|
+
"github.com/pyroscope-io/client/pyroscope.(*Session).dumpBlockProfile",
|
|
206
|
+
"github.com/pyroscope-io/pyroscope/pkg/parser.updateMetrics",
|
|
207
|
+
"github.com/pyroscope-io/pyroscope/pkg/convert/pprof.(*RawProfile).Bytes",
|
|
208
|
+
"bytes.(*Reader).WriteTo",
|
|
209
|
+
"mime/multipart.(*part).Write",
|
|
210
|
+
"github.com/pyroscope-io/godeltaprof/internal/pprof.(*profileBuilder).pbSample",
|
|
211
|
+
"github.com/dgraph-io/badger/v2.(*DB).updateSize",
|
|
212
|
+
"github.com/dgraph-io/badger/v2.(*DB).calculateSize",
|
|
213
|
+
"github.com/dgraph-io/badger/v2.(*DB).calculateSize.func2",
|
|
214
|
+
"path/filepath.Walk",
|
|
215
|
+
"path/filepath.walk",
|
|
216
|
+
"path/filepath.readDirNames",
|
|
217
|
+
"os.(*File).Readdirnames",
|
|
218
|
+
"os.(*File).readdir",
|
|
219
|
+
"os.Lstat",
|
|
220
|
+
"os.lstatNolog",
|
|
221
|
+
"github.com/dgraph-io/badger/v2.(*DB).doWrites.func1",
|
|
222
|
+
"github.com/dgraph-io/badger/v2.(*DB).writeRequests",
|
|
223
|
+
"github.com/dgraph-io/badger/v2.(*valueLog).write",
|
|
224
|
+
"github.com/dgraph-io/badger/v2.(*logFile).encodeEntry"
|
|
225
|
+
],
|
|
226
|
+
"levels": [
|
|
227
|
+
[0, 2489323, 0, 0],
|
|
228
|
+
[
|
|
229
|
+
0, 355, 0, 216, 0, 2976, 0, 206, 0, 587818, 0, 139, 0, 721752, 0, 107,
|
|
230
|
+
0, 8192, 0, 100, 0, 691357, 0, 77, 0, 466797, 0, 19, 0, 10076, 0, 1
|
|
231
|
+
],
|
|
232
|
+
[
|
|
233
|
+
0, 355, 0, 217, 0, 2976, 0, 207, 0, 587818, 0, 140, 0, 721752, 0, 108,
|
|
234
|
+
0, 8192, 0, 101, 0, 691357, 0, 78, 0, 372, 0, 74, 0, 466425, 0, 20, 0,
|
|
235
|
+
64, 0, 17, 0, 10012, 0, 2
|
|
236
|
+
],
|
|
237
|
+
[
|
|
238
|
+
0, 355, 0, 218, 0, 2976, 0, 208, 0, 587818, 128, 141, 0, 721752, 0, 100,
|
|
239
|
+
0, 8192, 0, 102, 0, 6162, 0, 93, 0, 65119, 0, 90, 0, 1820, 0, 87, 0,
|
|
240
|
+
618256, 0, 79, 0, 372, 0, 75, 0, 466425, 0, 21, 0, 64, 64, 18, 0, 6663,
|
|
241
|
+
0, 11, 0, 3294, 0, 5, 0, 55, 0, 3
|
|
242
|
+
],
|
|
243
|
+
[
|
|
244
|
+
0, 355, 0, 219, 0, 2976, 0, 209, 128, 132462, 0, 200, 0, 367085, 38,
|
|
245
|
+
192, 0, 38299, 0, 173, 0, 64, 0, 171, 0, 30926, 0, 152, 0, 18854, 0,
|
|
246
|
+
142, 0, 9803, 0, 137, 0, 676660, 0, 101, 0, 35289, 0, 109, 0, 8192, 0,
|
|
247
|
+
103, 0, 3641, 0, 98, 0, 2521, 0, 94, 0, 65119, 32319, 91, 0, 1820, 0,
|
|
248
|
+
88, 0, 618256, 124336, 80, 0, 372, 372, 76, 0, 466425, 0, 22, 64, 6663,
|
|
249
|
+
21, 12, 0, 773, 401, 7, 0, 2521, 2521, 6, 0, 55, 55, 4
|
|
250
|
+
],
|
|
251
|
+
[
|
|
252
|
+
0, 355, 0, 148, 0, 2976, 0, 210, 128, 66439, 52, 179, 0, 66023, 0, 152,
|
|
253
|
+
38, 147198, 24, 194, 0, 219849, 0, 152, 0, 5407, 32, 179, 0, 32892, 0,
|
|
254
|
+
152, 0, 64, 64, 172, 0, 30926, 0, 153, 0, 18854, 0, 143, 0, 9803, 0, 93,
|
|
255
|
+
0, 676660, 0, 102, 0, 35289, 0, 110, 0, 8192, 0, 104, 0, 3641, 3641, 99,
|
|
256
|
+
0, 2521, 0, 95, 32319, 32768, 32768, 92, 0, 32, 32, 81, 0, 1820, 1820,
|
|
257
|
+
89, 124336, 370285, 370285, 86, 0, 123587, 0, 83, 0, 22, 0, 82, 0, 26,
|
|
258
|
+
26, 81, 372, 466425, 0, 23, 85, 6642, 24, 13, 401, 372, 0, 8
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
0, 355, 0, 149, 0, 2521, 0, 214, 0, 455, 0, 211, 180, 66387, 0, 180, 0,
|
|
262
|
+
66023, 0, 153, 62, 147174, 16384, 195, 0, 219849, 0, 153, 32, 5375, 0,
|
|
263
|
+
180, 0, 32892, 0, 153, 64, 30926, 0, 154, 0, 18854, 36, 144, 0, 7282, 0,
|
|
264
|
+
98, 0, 2521, 0, 138, 0, 668468, 0, 103, 0, 8192, 0, 119, 0, 2521, 0,
|
|
265
|
+
115, 0, 32768, 0, 111, 0, 8192, 0, 105, 3641, 2521, 0, 96, 561560,
|
|
266
|
+
123035, 123035, 85, 0, 552, 552, 84, 0, 22, 22, 81, 398, 466421, 0, 33,
|
|
267
|
+
0, 4, 0, 24, 109, 64, 64, 16, 0, 6554, 0, 14, 401, 372, 0, 9
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
0, 355, 355, 150, 0, 2521, 2521, 215, 0, 455, 0, 212, 180, 66301, 0,
|
|
271
|
+
188, 0, 24, 0, 181, 0, 62, 0, 205, 0, 65980, 0, 154, 0, 43, 0, 201,
|
|
272
|
+
16446, 130199, 0, 188, 0, 591, 0, 181, 0, 219849, 0, 154, 32, 4569, 0,
|
|
273
|
+
188, 0, 806, 0, 181, 0, 32892, 0, 154, 64, 30926, 0, 155, 36, 18818,
|
|
274
|
+
586, 145, 0, 7282, 7282, 99, 0, 2521, 0, 96, 0, 668468, 0, 104, 0, 8192,
|
|
275
|
+
0, 120, 0, 2521, 0, 116, 0, 32768, 0, 112, 0, 8192, 0, 106, 3641, 2521,
|
|
276
|
+
2521, 97, 685567, 16, 0, 66, 0, 466405, 0, 22, 0, 4, 0, 25, 173, 6554,
|
|
277
|
+
6554, 15, 401, 372, 372, 10
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
2876, 455, 455, 213, 180, 16895, 14054, 190, 0, 49406, 49406, 189, 0,
|
|
281
|
+
24, 0, 196, 0, 62, 0, 199, 0, 65980, 0, 155, 0, 43, 0, 202, 16446,
|
|
282
|
+
21301, 20682, 190, 0, 108898, 108898, 189, 0, 456, 0, 182, 0, 135, 0,
|
|
283
|
+
196, 0, 219849, 0, 155, 32, 2048, 0, 190, 0, 2521, 2521, 189, 0, 228, 0,
|
|
284
|
+
182, 0, 578, 0, 11, 0, 32892, 0, 155, 64, 30926, 0, 156, 622, 5396, 0,
|
|
285
|
+
5, 0, 548, 0, 2, 0, 12288, 0, 146, 7282, 2521, 2521, 97, 0, 16384, 0,
|
|
286
|
+
129, 0, 16384, 0, 126, 0, 458752, 0, 105, 0, 176948, 31130, 122, 0,
|
|
287
|
+
8192, 8192, 121, 0, 2521, 0, 117, 0, 32768, 0, 113, 0, 8192, 0, 106,
|
|
288
|
+
691729, 16, 0, 67, 0, 466405, 0, 34, 0, 4, 0, 26
|
|
289
|
+
],
|
|
290
|
+
[
|
|
291
|
+
17565, 91, 0, 199, 0, 2750, 2750, 191, 49406, 24, 24, 197, 0, 62, 0, 11,
|
|
292
|
+
0, 65980, 0, 156, 0, 43, 0, 56, 37128, 582, 0, 199, 0, 37, 37, 191,
|
|
293
|
+
108898, 456, 0, 183, 0, 135, 135, 197, 0, 219849, 0, 156, 32, 2048,
|
|
294
|
+
2048, 191, 2521, 228, 0, 183, 0, 578, 21, 12, 0, 32892, 0, 156, 64,
|
|
295
|
+
8192, 0, 166, 0, 22734, 0, 157, 622, 354, 354, 7, 0, 5042, 5042, 6, 0,
|
|
296
|
+
548, 0, 11, 0, 8192, 8192, 151, 0, 4096, 0, 147, 9803, 16384, 0, 130, 0,
|
|
297
|
+
16384, 0, 127, 0, 458752, 16384, 106, 31130, 139264, 131072, 124, 0,
|
|
298
|
+
6554, 6554, 123, 8192, 2521, 2521, 118, 0, 32768, 32768, 114, 0, 8192,
|
|
299
|
+
0, 106, 691729, 16, 0, 68, 0, 426071, 0, 52, 0, 40334, 0, 22, 0, 4, 0,
|
|
300
|
+
27
|
|
301
|
+
],
|
|
302
|
+
[
|
|
303
|
+
17565, 91, 0, 11, 52180, 62, 8, 12, 0, 10923, 0, 166, 0, 55057, 0, 157,
|
|
304
|
+
0, 43, 0, 57, 37128, 582, 0, 11, 108935, 456, 0, 184, 135, 219849, 0,
|
|
305
|
+
157, 4601, 228, 0, 184, 21, 557, 66, 13, 0, 32892, 0, 157, 64, 8192, 0,
|
|
306
|
+
167, 0, 793, 745, 161, 0, 21845, 0, 159, 0, 96, 0, 56, 6018, 548, 19,
|
|
307
|
+
12, 8192, 4096, 0, 148, 9803, 16384, 0, 131, 0, 16384, 16384, 128,
|
|
308
|
+
16384, 442368, 24576, 106, 162202, 8192, 8192, 125, 50035, 8192, 0, 106,
|
|
309
|
+
691729, 16, 0, 69, 0, 426071, 0, 53, 0, 40334, 0, 22, 0, 4, 0, 28
|
|
310
|
+
],
|
|
311
|
+
[
|
|
312
|
+
17565, 91, 11, 12, 52188, 54, 34, 13, 0, 10923, 0, 167, 0, 108, 0, 161,
|
|
313
|
+
0, 46757, 46757, 159, 0, 8192, 0, 56, 0, 43, 0, 203, 37128, 582, 25, 12,
|
|
314
|
+
108935, 456, 0, 185, 135, 32, 0, 161, 0, 219729, 64079, 159, 0, 88, 0,
|
|
315
|
+
56, 4601, 228, 0, 185, 87, 36, 36, 16, 0, 455, 455, 14, 0, 124, 0, 161,
|
|
316
|
+
0, 32768, 0, 56, 64, 8192, 0, 168, 745, 48, 0, 162, 0, 21845, 21845,
|
|
317
|
+
160, 0, 96, 0, 57, 6037, 529, 34, 13, 8192, 4096, 0, 149, 9803, 16384,
|
|
318
|
+
0, 132, 57344, 417792, 16384, 106, 220429, 8192, 0, 106, 691729, 16, 0,
|
|
319
|
+
70, 0, 426071, 0, 54, 0, 40334, 0, 35, 0, 4, 0, 29
|
|
320
|
+
],
|
|
321
|
+
[
|
|
322
|
+
17576, 80, 36, 13, 52222, 20, 20, 16, 0, 10923, 0, 168, 0, 108, 0, 162,
|
|
323
|
+
46757, 8192, 0, 57, 0, 43, 0, 204, 37153, 557, 42, 13, 108935, 456, 0,
|
|
324
|
+
186, 135, 32, 0, 162, 64079, 155650, 155650, 193, 0, 88, 0, 57, 4601,
|
|
325
|
+
228, 0, 186, 578, 124, 0, 162, 0, 32768, 0, 57, 64, 8192, 0, 169, 745,
|
|
326
|
+
48, 0, 163, 21845, 96, 96, 158, 6071, 40, 40, 16, 0, 455, 0, 14, 8192,
|
|
327
|
+
4096, 4096, 150, 9803, 16384, 0, 133, 73728, 401408, 0, 106, 220429,
|
|
328
|
+
8192, 0, 106, 691729, 16, 0, 71, 0, 426071, 0, 55, 0, 40334, 0, 36, 0,
|
|
329
|
+
4, 0, 30
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
17612, 44, 44, 16, 52242, 10923, 0, 169, 0, 108, 0, 163, 46757, 8192, 0,
|
|
333
|
+
158, 0, 43, 0, 148, 37195, 60, 60, 16, 0, 455, 0, 14, 108935, 456, 0,
|
|
334
|
+
198, 135, 32, 0, 163, 219729, 88, 88, 158, 4601, 228, 228, 187, 578,
|
|
335
|
+
124, 0, 163, 0, 32768, 0, 158, 64, 8192, 0, 170, 745, 48, 0, 164, 28052,
|
|
336
|
+
455, 455, 15, 22091, 16384, 0, 134, 73728, 401408, 24576, 106, 220429,
|
|
337
|
+
8192, 0, 106, 691729, 16, 0, 72, 0, 426071, 0, 56, 0, 40334, 0, 37, 0,
|
|
338
|
+
4, 0, 31
|
|
339
|
+
],
|
|
340
|
+
[
|
|
341
|
+
69898, 10923, 10923, 170, 0, 108, 108, 164, 46757, 8192, 0, 174, 0, 43,
|
|
342
|
+
0, 149, 37255, 455, 455, 15, 108935, 456, 456, 187, 135, 32, 0, 164,
|
|
343
|
+
225224, 124, 108, 164, 0, 32768, 0, 174, 64, 8192, 0, 124, 745, 48, 48,
|
|
344
|
+
165, 50598, 16384, 0, 135, 98304, 376832, 24576, 106, 220429, 8192, 0,
|
|
345
|
+
106, 691729, 16, 16, 73, 0, 426071, 16, 57, 0, 40334, 0, 22, 0, 4, 4, 32
|
|
346
|
+
],
|
|
347
|
+
[
|
|
348
|
+
127686, 8192, 0, 175, 0, 43, 43, 150, 147236, 32, 32, 165, 225332, 16,
|
|
349
|
+
16, 165, 0, 32768, 0, 175, 64, 8192, 8192, 125, 51391, 16384, 16384,
|
|
350
|
+
136, 122880, 352256, 8192, 106, 220429, 8192, 0, 106, 691761, 426055, 0,
|
|
351
|
+
45, 0, 40334, 0, 38
|
|
352
|
+
],
|
|
353
|
+
[
|
|
354
|
+
127686, 8192, 0, 176, 372659, 32768, 0, 176, 207103, 344064, 24576, 106,
|
|
355
|
+
220429, 8192, 0, 106, 691761, 61, 0, 46, 0, 425994, 0, 47, 0, 40334, 0,
|
|
356
|
+
22
|
|
357
|
+
],
|
|
358
|
+
[
|
|
359
|
+
127686, 8192, 0, 177, 372659, 32768, 0, 177, 231679, 319488, 8192, 106,
|
|
360
|
+
220429, 8192, 0, 106, 691761, 61, 0, 47, 0, 425994, 0, 58, 0, 40334, 0,
|
|
361
|
+
39
|
|
362
|
+
],
|
|
363
|
+
[
|
|
364
|
+
127686, 8192, 8192, 178, 372659, 32768, 32768, 178, 239871, 311296,
|
|
365
|
+
73728, 106, 220429, 8192, 0, 106, 691761, 61, 12, 48, 0, 425994, 0, 59,
|
|
366
|
+
0, 410, 0, 42, 0, 39924, 0, 40
|
|
367
|
+
],
|
|
368
|
+
[
|
|
369
|
+
854904, 237568, 81920, 106, 220429, 8192, 0, 106, 691773, 49, 17, 49, 0,
|
|
370
|
+
425994, 0, 30, 0, 410, 0, 43, 0, 39924, 39924, 41
|
|
371
|
+
],
|
|
372
|
+
[
|
|
373
|
+
936824, 155648, 8192, 106, 220429, 8192, 0, 106, 691790, 32, 32, 65, 0,
|
|
374
|
+
12, 0, 31, 0, 393214, 0, 63, 0, 32768, 0, 60, 0, 410, 0, 44
|
|
375
|
+
],
|
|
376
|
+
[
|
|
377
|
+
945016, 147456, 0, 106, 220429, 8192, 0, 106, 691822, 12, 12, 32, 0,
|
|
378
|
+
393214, 0, 64, 0, 32768, 0, 61, 0, 410, 0, 45
|
|
379
|
+
],
|
|
380
|
+
[
|
|
381
|
+
945016, 147456, 0, 106, 220429, 8192, 0, 106, 691834, 393214, 327678,
|
|
382
|
+
61, 0, 32768, 32768, 62, 0, 410, 0, 46
|
|
383
|
+
],
|
|
384
|
+
[
|
|
385
|
+
945016, 147456, 8192, 106, 220429, 8192, 0, 106, 1019512, 65536, 65536,
|
|
386
|
+
62, 32768, 410, 0, 47
|
|
387
|
+
],
|
|
388
|
+
[953208, 139264, 0, 106, 220429, 8192, 0, 106, 1117816, 410, 0, 48],
|
|
389
|
+
[953208, 139264, 0, 106, 220429, 8192, 0, 106, 1117816, 410, 0, 49],
|
|
390
|
+
[953208, 139264, 8192, 106, 220429, 8192, 0, 106, 1117816, 410, 0, 50],
|
|
391
|
+
[961400, 131072, 0, 106, 220429, 8192, 0, 106, 1117816, 410, 410, 51],
|
|
392
|
+
[961400, 131072, 0, 106, 220429, 8192, 0, 106],
|
|
393
|
+
[961400, 131072, 0, 106, 220429, 8192, 0, 106],
|
|
394
|
+
[961400, 131072, 0, 106, 220429, 8192, 0, 106],
|
|
395
|
+
[961400, 131072, 131072, 106, 220429, 8192, 0, 106],
|
|
396
|
+
[1312901, 8192, 8192, 106]
|
|
397
|
+
],
|
|
398
|
+
"numTicks": 2489323,
|
|
399
|
+
"maxSelf": 370285
|
|
400
|
+
},
|
|
401
|
+
"metadata": {
|
|
402
|
+
"appName": "pyroscope.server.alloc_objects",
|
|
403
|
+
"name": "pyroscope.server.alloc_objects 2023-05-23T10:42:22Z",
|
|
404
|
+
"startTime": 1684838542,
|
|
405
|
+
"endTime": 1684838842,
|
|
406
|
+
"query": "pyroscope.server.alloc_objects{}",
|
|
407
|
+
"maxNodes": 8192,
|
|
408
|
+
"format": "single",
|
|
409
|
+
"sampleRate": 0,
|
|
410
|
+
"spyName": "gospy",
|
|
411
|
+
"units": "objects"
|
|
412
|
+
},
|
|
413
|
+
"timeline": {
|
|
414
|
+
"startTime": 1684838540,
|
|
415
|
+
"samples": [
|
|
416
|
+
108392, 350708, 74225, 49002, 8226, 41042, 13776, 116035, 17738, 8812,
|
|
417
|
+
86866, 9192, 68128, 101299, 11317, 103256, 60298, 23767, 49193, 129964,
|
|
418
|
+
97855, 121456, 64624, 52804, 134349, 316234, 4990, 92364, 29662, 143779, 0
|
|
419
|
+
],
|
|
420
|
+
"durationDelta": 10
|
|
421
|
+
},
|
|
422
|
+
"annotations": []
|
|
423
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { isSameFlamebearer } from './uniqueness';
|
|
4
|
+
import { normalize } from './normalize';
|
|
5
|
+
|
|
6
|
+
// Just to make it easier to import "heavy" data
|
|
7
|
+
const testData = JSON.parse(
|
|
8
|
+
fs.readFileSync(path.join(__dirname, './testData.json'), 'utf-8')
|
|
9
|
+
);
|
|
10
|
+
const flame = normalize({ profile: testData });
|
|
11
|
+
|
|
12
|
+
describe('uniqueness', () => {
|
|
13
|
+
it('works', () => {
|
|
14
|
+
expect(isSameFlamebearer(flame, flame)).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
});
|