Skip to content

Commit

Permalink
[Profiling] Use CO2 and Cost values provided by the ES Profiling APIs (
Browse files Browse the repository at this point in the history
…#170612)

- Removes old flamegraph code replacing it with the ES Flamegraph API
- Creates new user settings
- Adds a feature flag to use the kibana CO2/Cost calculations instead of
the new version
- Reads CO2 and Cost from /Stacktraces and /Flamegraph APIs

Where do we show the CO2 and Cost values?
- Flamegraph toolip
- Flamegraph Frame information flyout
- Diff Flamegraph Summary
- Functions table
- Function information flyout
- Diff Functions Summary

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
cauemarcondes and kibanamachine authored Dec 4, 2023
1 parent 3aac9bd commit 7470d21
Show file tree
Hide file tree
Showing 69 changed files with 1,856 additions and 822 deletions.
17 changes: 0 additions & 17 deletions packages/kbn-profiling-utils/common/__fixtures__/README.md

This file was deleted.

298 changes: 298 additions & 0 deletions packages/kbn-profiling-utils/common/__fixtures__/base_flamegraph.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
/*
* 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 { BaseFlameGraph } from '../flamegraph';

export const baseFlamegraph: BaseFlameGraph = {
Edges: [
[1],
[2],
[3],
[4],
[5],
[6],
[7],
[8],
[9],
[10],
[11],
[12],
[13],
[14],
[15],
[16],
[17],
[18],
[19],
[20],
[21],
[22],
[23],
[24],
[25],
[26],
[27],
[28],
[29],
[30],
[31],
[32],
[33],
[34],
[],
],
FileID: [
'',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'fwIcP8qXDOl7k0VhWU8z9Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
'5JfXt00O17Yra2Rwh8HT8Q',
],
FrameType: [
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4,
],
Inline: [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
],
ExeFilename: [
'',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'metricbeat',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
'vmlinux',
],
AddressOrLine: [
0, 43443520, 67880745, 67881145, 53704110, 53704665, 53696841, 53697537, 53700683, 53696841,
52492674, 67626923, 67629380, 67630226, 51515812, 51512445, 51522994, 44606453, 43747101,
43699300, 43538916, 43547623, 42994898, 42994925, 14680216, 14356875, 3732840, 3732678, 3721714,
3719260, 3936007, 3897721, 4081162, 4458225, 1712873,
],
FunctionName: [
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'entry_SYSCALL_64_after_hwframe',
'do_syscall_64',
'__x64_sys_read',
'ksys_read',
'vfs_read',
'new_sync_read',
'seq_read_iter',
'm_show',
'show_mountinfo',
'kernfs_sop_show_path',
'cgroup_show_path',
],
FunctionOffset: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
SourceFilename: [
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
],
SourceLine: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
],
CountInclusive: [
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7,
],
CountExclusive: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 7,
],
AnnualCO2TonsInclusive: [
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
0.0013627551116480942, 0.0013627551116480942, 0.0013627551116480942,
],
AnnualCO2TonsExclusive: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0.0013627551116480942,
],
AnnualCostsUSDInclusive: [
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492, 61.30240940376492,
],
AnnualCostsUSDExclusive: [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 61.30240940376492,
],
Size: 35,
SamplingRate: 1,
SelfCPU: 7,
SelfAnnualCO2Tons: 0.0013627551116480942,
TotalAnnualCO2Tons: 0.04769642890768329,
SelfAnnualCostsUSD: 61.30240940376492,
TotalAnnualCostsUSD: 2145.5843291317715,
TotalCPU: 245,
TotalSamples: 7,
TotalSeconds: 4.980000019073486,
};
Loading

0 comments on commit 7470d21

Please sign in to comment.