Closed Bug 1688281 Opened 3 years ago Closed 3 years ago

FOG Labeled Metrics don't support IPC, FOG submetrics

Categories

(Toolkit :: Telemetry, task, P1)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: chutten, Assigned: chutten)

References

(Blocks 1 open bug)

Details

(Whiteboard: [telemetry:fog:m6])

Attachments

(1 file, 1 obsolete file)

The submetrics returned by FOG's LabeledMetric<T> are RLB metrics, not FOG metrics. This causes two problems:

  1. RLB types are being exposed by FOG's API (which is undesirable)
  2. Even if we add IPC support to LabeledMetric, without IPC-supporting FOG submetrics, it's rather unhelpful.
See Also: → 1675277
Blocks: 1692318

We now use FOG metrics in LabeledMetric (see bug 1675277), so what's left is enabling IPC support (for Labeled Counters only, naturally).

For simplicity's sake, let's make it so LabeledMetric is non-judgemental about IPC (get can be successfully called on child processes with even labeled string metrics (which don't do IPC)), leaving it up to the submetric instance to explode or not based on whether it's IPC-compliant.

Assignee: nobody → chutten
Status: NEW → ASSIGNED
Priority: P3 → P1

Since the metric APIs (like add()) are on the submetric, but the label
(and knowledge of labeledness) is restricted to LabeledMetric<>, we have to
leak our abstraction one way or another.

I chose to leak labeledness into the submetric since I only need to do it for
one metric type (Counter, since it's the only one that has IPC-compliant
methods).

Attachment #9206758 - Attachment is obsolete: true

Since the submetric deals with IPCPayload, the submetric needs to know its
label. We could add that to CounterMetric::Child, but adding an optional label
to the child variant of CounterMetric looked strange.

So instead, I introduce the Labeled*Metric types.
Well, LabeledStringMetric and LabeledBooleanMetric are just re-exports.
But LabeledCounterMetric knows its label in non-parent processes.
And in parent processes it just acts like a normal CounterMetric, thanks to the
metric traits.

To figure out how to handle all these types it encouraged me to remove lambdas
from the MLA FFI and solve it with hygienic identifier capture instead. Bonus.

Here's hoping I don't regret this additional level of abstraction later.

Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b9a630a56373
Add IPC support to FOG Labeled Counters r=janerik
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: