Made sure the telemetry AutoCounter and RuntimeAutoCounter increments are guarded against over/under flows.
MozReview-Commit-ID: 8CZhpKkthoB
--HG--
extra : rebase_source : 4eafb249555128f9bc9fc3ecea13983bfa402aab
In order to stay consistent with the AutoTimer api, allowed non-templates uses or AutoCounter.
MozReview-Commit-ID: 9qnAeQTIY9T
--HG--
extra : rebase_source : 57ac472030945bf0434a4616037ac0963dd3bbd5
Moved the runtime Telemetry::AutoTimer implementation to the Telemetry public API.
MozReview-Commit-ID: KNT6toDQUtR
--HG--
extra : rebase_source : 4c55df7321570d49daa0aef7b916e4550b1f2ffd
In order to stay consistent with the AutoTimer api, allowed non-templates uses or AutoCounter.
MozReview-Commit-ID: 9qnAeQTIY9T
--HG--
extra : rebase_source : 8c95992e2d291d628721febbc7b641b91c850288
Moved the runtime Telemetry::AutoTimer implementation to the Telemetry public API.
MozReview-Commit-ID: KNT6toDQUtR
--HG--
extra : rebase_source : 8d40759f616511f0a3a19d42c8105e6278bf7e2a
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
Extended the Telemetry::Accumulate() API to accept a string key and a nsTArray of Telemetry::LABELS_*
enums. The typesafety of the class templates ensures there are no label mismatches within the array.
Since there is no singular version for accumulating a single string label into a keyed categorical
histogram, support for the plural version with multiple string labels has not been included here.
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.
UBSan found some cases where people are setting the Telemetry AutoTimer values
of `start` that are in the future. Not a problem if the value for `end` is
further in the future... which it isn't always.
Let's normalize those cases to 0, shall we?
MozReview-Commit-ID: 7AdTMf2rss6
--HG--
extra : rebase_source : aa3415c85d80286cab9d44a2d6aea532493f7212
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
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.
--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
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
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
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
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
Create AccumulateCategoricalKeyed() to specify both key and value for the categorical histogram,
sinc AccumulateCategorical() only support non-keyed histogram.
MozReview-Commit-ID: qYMnL9P6Ik
--HG--
extra : rebase_source : 446543601e9234da25d292018d8a6e8a7ac7ba22
Changed |print("enum ID : uint32_t {", file=output)| to |print("enum HistogramID : uint32_t {", file=output)| at line 53 of the file |toolkit/components/telemetry/gen-histogram-enum.py|, and then replaced all the textual occurrences of |Telemetry::ID| to |Telemetry::HistogramID| and |ID| to |HistogramID| in 43 other files.
Batch the accumulations to only transmit every so often, so we don't incur
too much in the way of IPC overhead penalties.
What this doesn't do:
* remove or restructure child telemetry code to adapt to the new way
* send the telemetry anywhere
* allow for the child process to clear child histograms
* support anything but histograms (but this is expected and okay)
MozReview-Commit-ID: JnUkcmN3Ya7