Skip to content

Add support for generic counters and deduplicate our existing counter tracks #5752

@canova

Description

@canova

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:
    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:
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureWork that is user facing, and typically should be planned through https://airtable.com/shrRydo6UXhebprofile dataIssues related to the profile format, data structure, or profile upgraderstimelineIssues related to the header timeline view

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions