Implement multi-store for histograms

RESOLVED FIXED in Firefox 65

Status

()

enhancement
P1
normal
RESOLVED FIXED
9 months ago
8 months ago

People

(Reporter: janerik, Assigned: janerik)

Tracking

unspecified
mozilla65
Points:
3
Dependency tree / graph

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(4 attachments)

Histograms need to gain functionality to record into multiple stores.
Blocks: 1498173
Priority: -- → P3
Assignee: nobody → jrediger
Points: --- → 3
Priority: P3 → P1
This is a preparation for the following introduction of a new wrapper
type by that name, making it more explicit which class we're handling
This introduces a new wrapper `Histogram` that keeps track of the multiple stores a histogram can be in.
Histograms are stored in a hash table, indexed by the name of the store.

It has one optimization to support the majority of cases: a single `main` store.
For that it stores a direct pointer to the underlying base::Histogram and skips populating the map.
This saves an indirection and memory overhead of actually placing it into the hash table.

For now a snapshot only ever returns data from the main store.
Clearing a snapshot only clears the main store.
(This will both change in a follow-up)

Depends on D11904
This extendes the `KeyedHistogram` to keep track of the multiple stores a histogram can be in.
Keyed histograms are stored in a hash table, indexed by the name of the store.

It has one optimization to support the majority of cases: a single `main` store.
For that it stores a direct pointer to a map from keys to the underlying base::Histogram and skips populating the map.
This saves an indirection and memory overhead of actually placing it into a second hash table.

For now a snapshot only ever returns data from the main store.
Clearing a snapshot only clears the main store.
Getting the keys of a keyed histogram will only get it from the main store.
(This will change in a follow-up)

Depends on D11905
For now we test that storing still works and the main store is still accessed for snapshots and clearing.

Depends on D11906
Pushed by jrediger@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b362f996a039
Use fully-qualified name for histogram storage r=chutten
https://hg.mozilla.org/integration/autoland/rev/137130a36a22
Add multi-storage to plain histograms r=chutten
https://hg.mozilla.org/integration/autoland/rev/544d3ecf27ab
Add multi-storage to keyed histograms r=chutten
https://hg.mozilla.org/integration/autoland/rev/ed977fa7caf8
Test storing into multiple stores (and snapshotting main store) r=chutten
You need to log in before you can comment on or make changes to this bug.