-
Notifications
You must be signed in to change notification settings - Fork 453
Description
Currently we have lots of tracks that we pretty much copy pasted from each other and changed some parts of them to make them support the newer counters that we added:
They were intially all copy pasted from the "memory" track because it was the first counter that we had. Then the more counters we added to the profile data, the more we duplicated these track visualizations.
Ideally we should have a single track implementation for the counter data type (that can support all the differences in these individual tracks). And then we should use that one for all of them. That way, counter visualizations will be generic and this will allow us to add more counters from the backend (or any other data sources) in the future.
This will require some changes in the profile format and ideally we should also change the backend to support this new format.
Current counters that we have in the profile formats:
- gecko profile format:
profiler/src/types/gecko-profile.ts
Lines 308 to 320 in c70f208
export type GeckoCounter = { name: string; category: string; description: string; samples: { schema: { time: 0; count: 1; number: 2; }; data: Array<[number, number, number]>; }; }; - processed profile format:
Lines 498 to 529 in c70f208
export type RawCounterSamplesTable = { time?: Milliseconds[]; timeDeltas?: Milliseconds[]; // The number of times the Counter's "number" was changed since the previous sample. // This property was mandatory until the format version 42, it was made optional in 43. number?: number[]; // The count of the data, for instance for memory this would be bytes. count: number[]; length: number; }; export type GraphColor = | 'blue' | 'green' | 'grey' | 'ink' | 'magenta' | 'orange' | 'purple' | 'red' | 'teal' | 'yellow'; export type RawCounter = { name: string; category: string; description: string; color?: GraphColor; pid: Pid; mainThreadIndex: ThreadIndex; samples: RawCounterSamplesTable; };
┆Issue is synchronized with this Jira Task