Remove unused ES fields from Profiling UI (#205499)

Closes #204024

## Summary

This PR removes unused ES fields from Profiling UI.
This commit is contained in:
Milosz Marcinkowski 2025-01-13 12:16:21 +01:00 committed by GitHub
parent b328fe89c9
commit fbdc54e89e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 0 additions and 29 deletions

View file

@ -289,7 +289,6 @@ export const baseFlamegraph: BaseFlameGraph = {
Size: 35,
SamplingRate: 1,
SelfCPU: 7,
TotalCPU: 245,
TotalSamples: 7,
TotalSeconds: 4.980000019073486,
};

View file

@ -169,6 +169,5 @@ export const stacktraces: StackTraceResponse = {
},
executables: { '5JfXt00O17Yra2Rwh8HT8Q': 'vmlinux', fwIcP8qXDOl7k0VhWU8z9Q: 'metricbeat' },
stack_trace_events: { ['c2TovSbgCECd_RtKHxMtyQ']: 7 },
total_frames: 34,
sampling_rate: 1,
};

View file

@ -47,7 +47,6 @@ export interface BaseFlameGraph {
/** sampling rate */
SamplingRate: number;
TotalSamples: number;
TotalCPU: number;
SelfCPU: number;
AnnualCO2TonsExclusive: number[];
AnnualCO2TonsInclusive: number[];
@ -125,7 +124,6 @@ export function createFlameGraph(
TotalSeconds: base.TotalSeconds,
TotalSamples: base.TotalSamples,
SelfCPU: base.SelfCPU,
TotalCPU: base.TotalCPU,
SelfAnnualCO2KgsItems: base.AnnualCO2TonsExclusive.map(convertTonsToKgs),
TotalAnnualCO2KgsItems: base.AnnualCO2TonsInclusive.map(convertTonsToKgs),
SelfAnnualCostsUSDItems: base.AnnualCostsUSDExclusive,

View file

@ -17,7 +17,6 @@ import {
describe('Stack trace response operations', () => {
test('empty stack trace response', () => {
const original: StackTraceResponse = {
total_frames: 0,
sampling_rate: 1.0,
};
@ -26,7 +25,6 @@ describe('Stack trace response operations', () => {
stackTraces: new Map(),
stackFrames: new Map(),
executables: new Map(),
totalFrames: 0,
samplingRate: 1.0,
};
@ -43,9 +41,6 @@ describe('Stack trace response operations', () => {
expect(decoded.events.size).toEqual(expected.events.size);
expect(decoded.events.size).toEqual(0);
expect(decoded.totalFrames).toEqual(expected.totalFrames);
expect(decoded.totalFrames).toEqual(0);
});
test('stack trace response without undefineds', () => {
@ -82,7 +77,6 @@ describe('Stack trace response operations', () => {
abc: 'pthread.c',
def: 'def.c',
},
total_frames: 1,
sampling_rate: 1.0,
};
@ -138,7 +132,6 @@ describe('Stack trace response operations', () => {
['abc', { FileName: 'pthread.c' }],
['def', { FileName: 'def.c' }],
]),
totalFrames: 1,
samplingRate: 1.0,
};
@ -155,9 +148,6 @@ describe('Stack trace response operations', () => {
expect(decoded.events.size).toEqual(expected.events.size);
expect(decoded.events.size).toEqual(1);
expect(decoded.totalFrames).toEqual(expected.totalFrames);
expect(decoded.totalFrames).toEqual(1);
});
test('stack trace response with undefineds', () => {
@ -188,7 +178,6 @@ describe('Stack trace response operations', () => {
executables: {
abc: 'pthread.c',
},
total_frames: 1,
};
const expected: DecodedStackTraceResponse = {
@ -220,7 +209,6 @@ describe('Stack trace response operations', () => {
],
]),
executables: new Map([['abc', { FileName: 'pthread.c' }]]),
totalFrames: 1,
samplingRate: 1.0,
};
@ -237,8 +225,5 @@ describe('Stack trace response operations', () => {
expect(decoded.events.size).toEqual(expected.events.size);
expect(decoded.events.size).toEqual(1);
expect(decoded.totalFrames).toEqual(expected.totalFrames);
expect(decoded.totalFrames).toEqual(1);
});
});

View file

@ -79,8 +79,6 @@ export interface StackTraceResponse {
['stack_frames']?: ProfilingStackFrames;
/** executables */
['executables']?: ProfilingExecutables;
/** total frames */
['total_frames']: number;
/** sampling rate */
['sampling_rate']: number;
}
@ -95,8 +93,6 @@ export interface DecodedStackTraceResponse {
stackFrames: Map<StackFrameID, StackFrame>;
/** Map of file ID and Executables */
executables: Map<FileID, Executable>;
/** Total number of frames */
totalFrames: number;
/** sampling rate */
samplingRate: number;
}
@ -207,7 +203,6 @@ export function decodeStackTraceResponse(
stackTraces,
stackFrames,
executables,
totalFrames: response.total_frames,
samplingRate: response.sampling_rate,
};
}

View file

@ -287,7 +287,6 @@ export const baseFlamegraph: BaseFlameGraph = {
Size: 35,
SamplingRate: 1,
SelfCPU: 7,
TotalCPU: 245,
TotalSamples: 7,
TotalSeconds: 4.980000019073486,
};

View file

@ -46,7 +46,6 @@ function mergeStackTracesByDepth(response) {
}
});
let totalFrames = 0;
const stackTraceEvents = {};
const stackTraces = {};
@ -54,7 +53,6 @@ function mergeStackTracesByDepth(response) {
const { event, count } = eventsByFrameDepth[depth];
stackTraces[event] = response.stack_traces[event];
stackTraceEvents[event] = count;
totalFrames += stackTraces[event].frame_ids.length * count;
});
return {
@ -62,7 +60,6 @@ function mergeStackTracesByDepth(response) {
stack_traces: stackTraces,
stack_frames: response.stack_frames,
executables: response.executables,
total_frames: totalFrames,
sampling_rate: response.sampling_rate,
};
}
@ -97,7 +94,6 @@ function purgeUnusedFramesAndExecutables(response) {
stack_traces: response.stack_traces,
stack_frames: stackFrames,
executables: executables,
total_frames: response.total_frames,
sampling_rate: response.sampling_rate,
};
}