Pieces include
* A script for collecting all the ids for metric _types_
* A template for generating the factory that can build each of those types
* mozbuild integration
Differential Revision: https://phabricator.services.mozilla.com/D143048
Previously we used the 27th bit to signal if a metric instance was actually a
labeled_* metric's "submetric". This bit is actually part of the metric type
part of the lower (upper?) 32 bits of the metric_entry_t, but that was okay
because builtin metrics all have their top 5 bits scrubbed.
itsFreeRealEstate.jpg
This can no longer work, though, since JOG will need to be able to have its
own submetrics that don't conflict _and_ will need to keep the type bits
around so we know what instances to build.
(( Yes, yes, I could've designed the system so that we didn't need to,
but this was the less complicated way. We can go down this route when we
provision the 34 Millionth metric and run out of space. ))
So that means taking two bits away from the id portion: one for runtime (we'll
give it 2^26) and one for submetric (2^25).
Differential Revision: https://phabricator.services.mozilla.com/D143044
Upgrades to Glean v50.0.1, which comes with a rewritten core and
UniFFI-powered bindings.
Glean has some API changes, so we swap it over to that. Mostly mechanical changes.
Also upgrades to inherent v1.0 in fog.
This matches what Glean uses internally and gets rid of one duplicated crate.
Also upgrades to glean-parser==6.0.1
One crate duplication now (change in `python/mozbuild/mozbuild/vendor/vendor_rust.py` required).
Some new crates now vendored.
These are transitive dependencies of Glean dependencies, all with valid
licenses and already used in other products (mobile).
Differential Revision: https://phabricator.services.mozilla.com/D146062
This adds both the core Rust implementation and the
code to enable the needed language bindings. This
additionally enables GIFFT on the URL type, mirroring
them to a string scalar.
Differential Revision: https://phabricator.services.mozilla.com/D145215
We need to clear state at shutdown that we hold for GIFFT mirroring purposes.
However, more data can come in even later (there's nothing stopping it. Plus,
Glean can meaningfully record later given its shutdown happens in a later
phase), so the naive approach of lazy-instantiate and RunOnShutdown-clear
doesn't work.
Since Telemetry is only good to AppShutdownTelemetry, we now fail to mirror to
it after AppShutdownTelemetry and clear state in the immediately-next phase.
Also, data can come in earlier than we have a main thread to dispatch to,
requiring some careful finagling of threads to ensure our cleanup routine
is appropriately registered.
Differential Revision: https://phabricator.services.mozilla.com/D143522
If we don't, we assert if the first GIFFT-enabled timing distribution's
instrumentation thread on a given process is not the main thread.
Differential Revision: https://phabricator.services.mozilla.com/D141632
Based on our experience with Firefox for Android, annotating Glean metrics
with issue tracker component information can provide valuable context to
anyone searching for metrics.
This adds a new set of tags corresponding to the components in the
tree, annotates the existing Glean metrics. Finally, it also adds a new
mach command called `update-glean-tags` to update the tags files based
on build metadata.
Differential Revision: https://phabricator.services.mozilla.com/D134332
Based on our experience with Firefox for Android, annotating Glean metrics
with issue tracker component information can provide valuable context to
anyone searching for metrics.
This adds a new set of tags corresponding to the components in the
tree, annotates the existing Glean metrics. Finally, it also adds a new
mach command called `update-glean-tags` to update the tags files based
on build metadata.
Differential Revision: https://phabricator.services.mozilla.com/D134332
This replaces the default-used `RandomState`[1] on the hashmaps used in
FOG's IPC with a simple wrapper around `DefaultHasher`.
`RandomState` uses `DefaultHasher` internally, which at the moment of
this commit, uses `SipHasher13` internally.
Our `HashState` does the same, but with default keys of `(0, 0)`
(whereas `RandomState` uses some random keys).
This will result in the same hashes used for the same values in
different hashmaps.
But this should be fine for the use here:
The key for all those hash maps is a `MetricId`, which is a simple `u32`.
It's already a unique identifier generated from defined metrics and not
user-manipulated.
Therefore we shouldn't need to worry about HashDos-resistance.
[1]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html
Differential Revision: https://phabricator.services.mozilla.com/D135208
With the former 3 enabled we can enable labeled metrics as well,
because they only exist for these 3.
That also makes testing easier because we don't need to special case
that.
Differential Revision: https://phabricator.services.mozilla.com/D126800
The code was already trying to do this but was comparing tuples instead of
mirror probe names. Guess it got missed in a refactor.
Amusingly I was violating the invariant in two places and had to fix 'em : |
Differential Revision: https://phabricator.services.mozilla.com/D127546
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.
Differential Revision: https://phabricator.services.mozilla.com/D121512
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.
Differential Revision: https://phabricator.services.mozilla.com/D121512
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.
Differential Revision: https://phabricator.services.mozilla.com/D121512
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.
Differential Revision: https://phabricator.services.mozilla.com/D121512
Without these annotations the literals will be assumed to be `int` so as soon
as there's a literal that cannot be represented as such it'll warn.
And CI builds with warnings as errors.
`metric_entry_t` is `uint64_t` which is `unsigned long long int` which is `ull`
`category_entry_t` is `uint32_t` which is `unsigned long int` which is `ul`
Differential Revision: https://phabricator.services.mozilla.com/D119978
Also includes an upgrade to glean_parser.
Enables GIFFT as well, mapping between Glean's custom distribution and
Firefox Telemetry's linear or exponential histograms directly.
Differential Revision: https://phabricator.services.mozilla.com/D117420