This changes the build system to add a new define when on
Android or when tests are enabled, MOZ_TELEMETRY_GECKOVIEW.
MozReview-Commit-ID: 5n2A8G2ZzRK
--HG--
rename : toolkit/components/telemetry/tests/gtest/TelemetryFixture.h => toolkit/components/telemetry/tests/gtest/TelemetryFixture.cpp
extra : rebase_source : 09e42c85b754f3fd5d9d699b1b52f8afe8694a5c
This implements the persistence timer and the logic to write measurements
to a persistence file off-the-main thread using JSONWriter. The code to
load persisted measurements off the disk uses the builtin JSON parsing
functions from JS (as we cannot use jsoncpp).
It additionally exposes the ClearProbes method to clear the probe storage and
trigger clearing the persisted data (GeckoView only).
MozReview-Commit-ID: 94FoZac47Cw
--HG--
extra : rebase_source : 9d207958932ae0d8063bf137c0c7078c6103edb4
This changes the build system to add a new define when on
Android or when tests are enabled, MOZ_TELEMETRY_GECKOVIEW.
MozReview-Commit-ID: 5n2A8G2ZzRK
--HG--
rename : toolkit/components/telemetry/tests/gtest/TelemetryFixture.h => toolkit/components/telemetry/tests/gtest/TelemetryFixture.cpp
extra : rebase_source : a12fb699982170d6244e0153d7bbc5cdc8386cd8
This implements the persistence timer and the logic to write measurements
to a persistence file off-the-main thread using JSONWriter. The code to
load persisted measurements off the disk uses the builtin JSON parsing
functions from JS (as we cannot use jsoncpp).
It additionally exposes the ClearProbes method to clear the probe storage and
trigger clearing the persisted data (GeckoView only).
MozReview-Commit-ID: 94FoZac47Cw
--HG--
extra : rebase_source : 9d207958932ae0d8063bf137c0c7078c6103edb4
On Desktop and GeckoView we only ever need to store histograms for a
subsession and clear the histograms when a snapshot is done (e.g. a main ping is built).
On Fennec we don't have subsessions and only store for a session and never clear the storage.
MozReview-Commit-ID: BeVi86kZPs2
--HG--
extra : rebase_source : 50bb218c9fb9a04c8d60d6300e4e9e67544232c0
On Desktop and GeckoView we only ever need to store histograms for a
subsession and clear the histograms when a snapshot is done (e.g. a main ping is built).
On Fennec we don't have subsessions and only store for a session and never clear the storage.
MozReview-Commit-ID: BeVi86kZPs2
--HG--
extra : rebase_source : 50bb218c9fb9a04c8d60d6300e4e9e67544232c0
This should only be used in xpcshell on Android after toggling the GeckoView mode.
This is a workaround as we have no better way to detecting the current product (Fennec or GeckoView) on Android.
MozReview-Commit-ID: LEHt1Gt3JJ7
--HG--
extra : rebase_source : 44092e84d1dd9518ab4a7f5706a98ed0eb58f1b6
This patch enables the Firefox Telemetry core to register and record
to dynamic builtin scalars.
MozReview-Commit-ID: 8FeAgmmsQXw
--HG--
extra : rebase_source : f5eddb24bb8c16b75a49850568efd38141eb6a5a
Telemetry's AutoTimer Microsecond resolution was not used. I removed it with the TimerResolution enum, which allowed me to remove a couple of templates as well.
MozReview-Commit-ID: 76qHgmYEsE3
--HG--
extra : rebase_source : 1f5826f1be990d4814de15875cd0a726213712d4
This patch enables generating a JSON file that mirrors the scalar definitions
in Scalars.yaml. On local developer builds, this file is loaded when Firefox
starts to register all the scalars. If some change was introduced in the
definition files, the new scalar will be dynamically added.
The JSON definition file will be regenerated every time an artifact build
is performed or the build faster command is invoked.
MozReview-Commit-ID: Do3WjE38aIK
--HG--
extra : rebase_source : 64fdd324bf760412bc1504a2f1c2b8952096c513
This patch enables generating a JSON file that mirrors the scalar definitions
in Scalars.yaml. On local developer builds, this file is loaded when Firefox
starts to register all the scalars. If some change was introduced in the
definition files, the new scalar will be dynamically added.
The JSON definition file will be regenerated every time an artifact build
is performed or the build faster command is invoked.
MozReview-Commit-ID: Do3WjE38aIK
--HG--
extra : rebase_source : 2d9701d77abeb6ce8de096674349b6d071c4b102
Telemetry::Accumulate now supports two new signatures: Accumulate(HistogramId, nsTArray stringLabels) and
Accumulate(nsTArray enumValues). In the stringLabels case, if the array contains an invalid label, then no
samples are accumulated at all. In the enumValues array case, the class template ensures that we do not have
a mismatch of labels in the array, since the enumValues class is tied to the id of the histogram we want to
accumulate to.
Extended the Telemetry::Accumulate API to take a Histogram ID, string key, and a nsTArray<uint32_t> of samples.
Test cases check for linear, count and histograms with a set of allowed keys. Made changes to fix try failures.
Added another Telemetry::Accumulate function that takes a histogram id and an array of samples as arguments.
As of this patch, adding multiple samples to keyed and categorical histograms is not supported.
--HG--
extra : rebase_source : e84c53d23c9d2a6fc07f57b626e76e09c61c3bee
We're starting a shift towards talking about release/prerelease data instead of
base/extended collection. For now this is just a naming change.
At the same time, we can render these attributes read-only, which is nice.
MozReview-Commit-ID: IRuKpzLYW7i
--HG--
extra : rebase_source : 866fd35f854aaa0c504795912e82d443521c4952
We're starting a shift towards talking about release/prerelease data instead of
base/extended collection. For now this is just a naming change.
At the same time, we can render these attributes read-only, which is nice.
MozReview-Commit-ID: IRuKpzLYW7i
--HG--
extra : rebase_source : 7f6ae060a520f9685c279b680a9356070fb93923
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.
This patch greatly simplifies how things are exposed. The starting point is:
- GeckoProfiler.h can be #included unconditionally;
- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.
In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.
The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.
Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
With the removal of the old addonHistograms, all histograms are now registered.
So removing registered(Keyed)Histograms should be straightforward?
Unfortunately not, as this was how we filtered data based on dataset
(opt-in/opt-out), so a little more fiddling was needed to get C++ to only
serialize dataset-appropriate data (instead of post-facto filtering it in JS).
MozReview-Commit-ID: HDplhmzmzJl
--HG--
extra : rebase_source : 9c38c97e39e3c4fb192288d751505e1f0f2a2c6d
HangAnnotations was very complex, required a separate allocation, and used this
unfortunate virtual interface implementation which made it harder to do
interesting things with it (such as serialize it over IPC).
This new implementation is much simpler and more concrete, making
HangAnnotations simply be a nsTArray<Annotation>. This also simplifies some of
the IPC code which was added in part 7.
MozReview-Commit-ID: EzaaxdHpW1t
We're going to use HangDetails as the type containing hang information. We'll
have a JS component which reads the data out of nsIHangDetails, builds the
payload, and submits it to telemetry for us.
We'll do it in JS because telemetry has to be submitted from JS.
This patch also adds IPC serization for the relevant types so that we can send
HangDetails objects over IPDL.
MozReview-Commit-ID: CeikKabY9Vs
HangAnnotations was very complex, required a separate allocation, and used this
unfortunate virtual interface implementation which made it harder to do
interesting things with it (such as serialize it over IPC).
This new implementation is much simpler and more concrete, making
HangAnnotations simply be a nsTArray<Annotation>. This also simplifies some of
the IPC code which was added in part 7.
MozReview-Commit-ID: EzaaxdHpW1t
We're going to use HangDetails as the type containing hang information. We'll
have a JS component which reads the data out of nsIHangDetails, builds the
payload, and submits it to telemetry for us.
We'll do it in JS because telemetry has to be submitted from JS.
This patch also adds IPC serization for the relevant types so that we can send
HangDetails objects over IPDL.
MozReview-Commit-ID: CeikKabY9Vs
To cut down on complexity, we don't require specifying any expiry versions.
Given that these events will be recorded non-persistently from off-train add-ons, they can be expired by shipping new add-on releases.
We also start to use the new "record on release" terminology here instead of opt-in/opt-out, but are not changing the internal functionality yet.
Technically, this is implemented by keeping a separate registry for the dynamic event information.
Built-in & dynamic events are tracked with separate numeric ids, so introduce a common identifier for both, an EventKey.
For actual event storage, the events are treated the same as built-in events. They are simply bucketed into the 'dynamic' process storage.
This approach ends up duplicating code paths that use the event info, but keeps a single implementation for recording, storage & serialization.
--HG--
extra : rebase_source : 639f9353a7e9383efe87f7f059ca83b56fb3b2a7
TelemetrySession's getKeyedHistograms asks for each keyed histogram
individually. This is inefficient and doesn't work well with the storage
refactor.
So, plumb through a subsession keyed histogram snapshot API and convert
TelemetrySession over to using it.
MozReview-Commit-ID: Af9dTqw99UA
The Chromium IPC histogram code used the StatisticsRecorder object for storage.
This is keyed by histogram name, which doesn't match our storage reality anymore.
Instead we use a name to refer to a set of histogram instances that record data from different processes, as well as separating session and subsession data.
Consequently we need to rewrite this storage, which means StatisticsRecorder is not used anymore.
MozReview-Commit-ID: 1LC7YubpKaD