Commit Graph

93 Commits

Author SHA1 Message Date
FSeita
bc9e6fa603 Bug 1376333 - Improve naming of accumulation types & variables r=Dexter
MozReview-Commit-ID: F9w7CLUOP6r
2017-09-13 11:20:36 +02:00
Doug Thayer
297ca9d1d7 Bug 1397376 - Avoid copying on initializing histogram ranges r=gfritzsche
Since LinearHistogram and its descendants inherit ranges_ from
Histogram, and we wanted to replace the copying into a std::vec
for Histogram, the simplest approach seemed to just be to
precompute ranges for all histograms, exponential or otherwise.
This should have the added benefit of reducing the memory
footprint for those histograms, since they will benefit from the
deduplication work that the precomputing script already does.

MozReview-Commit-ID: JTV5Dej5ZIb
2017-09-08 12:13:44 -07:00
Chris H-C
97ba53dc5e bug 1373240 - Use somewhat-more-dynamically-allocated histogram storage r=Dexter,gfritzsche
Switch from static multi-dimensional arrays to dynamic one-dimensional arrays
that are only allocated in the parent process.

MozReview-Commit-ID: tyGEFhU2Fq
2017-08-29 15:05:35 -04:00
Sebastian Hengst
656ad5ff03 Backed out changeset 0181bf16af4f (bug 1373240) for leaks detected by asan. r=backout 2017-09-08 16:47:04 +02:00
Chris H-C
3dddcf48de bug 1373240 - Use somewhat-more-dynamically-allocated histogram storage r=Dexter,gfritzsche
Switch from static multi-dimensional arrays to dynamic one-dimensional arrays
that are only allocated in the parent process.

MozReview-Commit-ID: tyGEFhU2Fq
2017-08-29 15:05:35 -04:00
Chris H-C
eabcba7afb bug 1376600 - Remove registered(Keyed)Histograms r=Dexter
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
2017-08-22 09:42:09 -04:00
Jan de Mooij
f9f0443c9f Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Alessio Placitelli
5329b408e3 Bug 1343855 - Part 2 - Add support for key whitelists in keyed histograms. r=gfritzsche, data-review=francois
MozReview-Commit-ID: H2pE3VivWIX
2017-05-17 04:10:00 +02:00
Doug Thayer
b419dc7f86 Bug 1383210 - Use precomputed histogram buckets r=gfritzsche
The log and exp calls in base::Histogram::InitializeBucketRange()
were showing up in profiles. This patch uses the precomputed
buckets for exponential histograms instead of computing them at
runtime. Though linear histograms do show up in the profile that
prompted this change, they contribute much less, and due to the
trivial nature of generating these, it's unlikely that a static
cache would provide much if any speedup.

MozReview-Commit-ID: IavFwoWjFhk
2017-08-04 10:02:28 -07:00
Wes Kocher
5f9ee65672 Backed out changeset 277c7e4952a8 (bug 1383210) for flake8 failures a=backout
MozReview-Commit-ID: 3j1ROBxjf2Z
2017-08-08 12:38:41 -07:00
Doug Thayer
da71c2e874 Bug 1383210 - Use precomputed histogram buckets r=gfritzsche
The log and exp calls in base::Histogram::InitializeBucketRange()
were showing up in profiles. This patch uses the precomputed
buckets for exponential histograms instead of computing them at
runtime. Though linear histograms do show up in the profile that
prompted this change, they contribute much less, and due to the
trivial nature of generating these, it's unlikely that a static
cache would provide much if any speedup.

MozReview-Commit-ID: IavFwoWjFhk
2017-08-04 10:02:28 -07:00
Dean
deb71c0ef5 Bug 1381470 - Added a less memory consuming method to tell if a histogram is empty. r=chutten 2017-07-31 21:38:48 +02:00
Chris H-C
bb4cb30677 bug 1366294 - Part 12 - Clean up after onesself. r=gfritzsche
Without the StatisticsRecorder cleaning up after us we need to now manually
delete the Histograms we create.

MozReview-Commit-ID: 8jrPPBQmU0Z
2017-07-24 09:52:26 -04:00
Chris H-C
f0f263244d bug 1366294 - Part 10 - Nail down count histogram semantics. r=gfritzsche
Previously we assumed count histograms were always present in payloads.
This was an erroneous assumption as count histograms were only 0 if they were
session histograms, or if they were from subsession histograms from subsessions
_after_ a subsession when they held a non-0 value.

So let's just treat count histograms as normal histograms from now on, without
any of this "sometimes 0" nonsense. This simplifies the code, tests, and our
understanding... and _should_ have few/zero downstream effects since the
existing behaviour was so poorly-understood (though exactly tested).

MozReview-Commit-ID: BH108ksygGw
2017-07-24 09:52:26 -04:00
Chris H-C
43ee3b33fc bug 1366294 - Part 7 - Use keyed histogram snaphots to build payloads. r=gfritzsche
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
2017-07-24 09:52:26 -04:00
Chris H-C
1c9b6f562a bug 1366294 - Part 5 - Send appropriately-structured Telemetry data to JS r=gfritzsche
Previously we were doing bad string manipulation nonsense. Now when asked for
snapshots C++ can return a properly-formated Object tree.

MozReview-Commit-ID: HAvIbgzUvMU
2017-07-24 09:52:26 -04:00
Chris H-C
52df6d3dce bug 1366294 - Part 4 - Small cleanups to previous patches. r=gfritzsche
MozReview-Commit-ID: 7PioVNfUUNZ
2017-07-24 09:52:26 -04:00
Georg Fritzsche
ea803304a2 Bug 1366294 - Part 3 - Refactor TelemetryHistogram storage. r=chutten
Previously we used the base::StatisticsRecorder object for storage by name.
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.

In this re-write, we instead introduce the following lookup paths (managed in TelemetryHistogram.cpp):
- Main storage:
  - (histogramId, processId, sessionOrSubsession) -> Histogram*
  - (histogramId, processId) -> KeyedHistogram* (this handles subsessions internally)
- Lookup:
  - (histogramName) -> histogramId
  - (HistogramID) -> bool (is recording enabled for this histogram?)

This is wrapped with a few lookup functions.

This also allows us to keep HistogramIDs in the JS histogram instances now, instead of pointers to Histogram instances.
That means Histogram instance life-time management is now properly contained inside TelemetryHistogram.cpp.

MozReview-Commit-ID: 5yijGv7mc89
2017-07-24 09:52:26 -04:00
Georg Fritzsche
bccaccd801 Bug 1366294 - Part 1 - Remove base::StatisticsRecorder. r=chutten
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
2017-07-24 09:52:26 -04:00
Bill McCloskey
69b44c007d Bug 1380880 - Use process type to distinguish keyed histograms (r=chutten)
MozReview-Commit-ID: 8pcou7DsU7S
2017-07-14 12:44:54 -07:00
Igor Timofeev
2c1ec45b58 Bug 1374628 - Improve static_asserts in TelemetryHistogram.cpp. r=gfritzsche
With bug 1374419 solved, static asserts in TelemetryHistogram.cpp can be improved.

Specifically, JS::gcreason::NUM_TELEMETRY_REASONS can now be compared against GC_MINOR_REASON, GC_MINOR_REASON_LONG, and GC_REASON_2 in the now constexpr gHistograms. Likewise, mozilla::StartupTimeline::MAX_EVENT_ID can be compared against STARTUP_MEASUREMENT_ERRORS.

This commit modifies the static asserts to perform these comparisons in place of ones against hardcoded values and modifies the accompanying comment to remove the TODO section.
2017-06-21 14:02:36 +01:00
Chris H-C
89b1d30556 Bug 1335343 - Prevent histogram recording in disallowed processes. r=Dexter
Unfortunately it means using FLAG histograms because I need to test that their
"we have a hidden default value" behaviour is appropriately silenced as well.

MozReview-Commit-ID: J8xGXwCTRIg
2017-06-13 07:10:00 -04:00
Georg Fritzsche
940a7067c5 Bug 1361661 - Part 3 - Update the Telemetry core. r=dexter
Updates the core Telemetry code to use the new headers and support the extension process.
TelemetryHistogram is not cleanly refactored here; doing this uncovered a few time consuming issues with the various lookup code paths.
2017-05-23 13:48:13 +07:00
Sebastian Hengst
2d99162f7f Backed out changeset 42a4e28e6210 (bug 1361661) 2017-05-22 20:40:17 +02:00
Georg Fritzsche
ab50d638c5 Bug 1361661 - Part 3: Update the Telemetry core. r=dexter
Updates the core Telemetry code to use the new headers and support the extension process.
TelemetryHistogram is not cleanly refactored here; doing this uncovered a few time consuming issues with the various lookup code paths.
2017-05-22 15:41:14 +07:00
Sebastian Hengst
de9a911353 Backed out changeset d1932fb366d4 (bug 1361661) 2017-05-22 16:19:21 +02:00
Georg Fritzsche
0f76edd4d9 Bug 1361661 - Part 3: Update the Telemetry core. r=dexter
Updates the core Telemetry code to use the new headers and support the extension process.
TelemetryHistogram is not cleanly refactored here; doing this uncovered a few time consuming issues with the various lookup code paths.
2017-05-22 15:41:14 +07:00
Ehsan Akhgari
88afb100de Backout bug 1350765 for having caused bug 1358259 2017-04-25 11:20:04 -04:00
Ehsan Akhgari
9d584db59a Bug 1350765 - Avoid recomputing the histogram ID when it's available in the caller; r=chutten 2017-04-19 12:02:30 -04:00
Chris H-C
a2a550854b bug 1353295 - Remove addonHistograms from Telemetry r=Dexter
addonHistograms isn't being used and has started getting in the way.
So it goes.

Leave the "Addon Histograms" section in about:telemetry for 60 days.
Remove it in bug 1355882

MozReview-Commit-ID: 4lm7ONirofl
2017-04-06 15:31:58 -04:00
Markus Stange
600220e2a0 Bug 1356898 - Use nsAutoCString in two places in TelemetryHistogram.cpp. r=froydnj
MozReview-Commit-ID: 3njPBvdhwRj
2017-04-16 14:18:00 -04:00
Carsten "Tomcat" Book
6d5a053fe2 Backed out changeset cfe47bace342 (bug 1353295) for assertion failures 2017-04-13 09:39:17 +02:00
Chris H-C
79504a7b9d bug 1353295 - Remove addonHistograms from Telemetry r=Dexter
addonHistograms isn't being used and has started getting in the way.
So it goes.

Leave the "Addon Histograms" section in about:telemetry for 60 days.
Remove it in bug 1355882

MozReview-Commit-ID: 4lm7ONirofl
2017-04-06 15:31:58 -04:00
Georg Fritzsche
7d536d302f Bug 1347216 - Fix categorical keyed histograms. r=Dexter
This also fixes an existing bug where we checked for the wrong type in JSKeyedHistogram_Add().
KeyedHistogram::GetHistogramType() returns one of the histogram types from nsITelemetry.idl, not one of the chromium types (base::*).

I extended the test coverage accordingly, as it seemed to be lacking.
2017-04-07 20:55:51 +07:00
Gregory Moore
58aad3a66b Bug 1120409 - nsITelemetry.histogramSnapshots will no longer return keyed histograms. r=chutten 2017-03-24 12:38:24 -07:00
Alessio Placitelli
935681bcef Bug 1321349 - Make histogram.add check 'this' for the proper JSClass. r=gfritzsche 2017-02-21 01:55:00 +01:00
Carsten "Tomcat" Book
31efc35cdf Backed out changeset 5733e0b0e096 (bug 1120409) for causing frequent timeouts in test_XHR_timeout.html 2017-03-21 11:28:38 +01:00
Gregory Moore
1a10eeec68 Bug 1120409 - nsITelemetry.histogramSnapshots will no longer return keyed histograms. r=gfritzsche 2017-02-22 14:53:56 -08:00
clinton
4213fb3b39 Bug 1346208 - Remove B2G-specific code from Telemetry C++ modules r=gfritzsche
MozReview-Commit-ID: 3iU7OcHePno
2017-03-12 10:38:22 +11:00
Tom Tromey
5b535c20c5 Bug 1345626 - remove KeyedHistogram::GetDataset; r=Dexter
MozReview-Commit-ID: 8I7WKHfl0RA
2017-03-08 14:39:24 -07:00
Vedant Sareen
d21da17bda Bug 1341236 - Drop the |dataset()| function from keyed & plain histograms. r=Dexter
Dropped the dataset() functions from keyed and plain histograms in file |toolkit/components/telemetry/TelemetryHistogram.cpp| to prevent their unnecessary exposure while getting histograms using the getHistogramById function (or its keyed counterpart).
Also removed the (now redundant) |internal_JSHistogram_Dataset()| and |internal_JSKeyedHistogram_Dataset()| functions from the same file and tests from the file |toolkit/components/telemetry/tests/unit/test_TelemetryHistograms.js| as the same tests are performed later on in that very file.
2017-03-06 19:06:53 +05:30
Alessio Placitelli
9cf522342c Backed out changeset 3bb2c974b5dc due to Browser Console spamming (bug 1334469) 2017-02-23 18:23:50 +01:00
Alessio Placitelli
50767397f0 Bug 1334469 - Make sure Keyed Histogram APIs don't allow empty keys. r=gfritzsche
iff --git a/toolkit/components/telemetry/docs/collection/histograms.rst b/toolkit/components/telemetry/docs/collection/histograms.rst

MozReview-Commit-ID: EkiP42ZVpqz
2017-02-21 06:03:00 +01:00
Vedant Sareen
a85a2ad339 Bug 1330907 - Rename Telemetry::ID to Telemetry::HistogramID. r=dexter
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.
2017-02-16 00:45:15 +05:30
Georg Fritzsche
2011d0ae0c Bug 1339749 - Refactor Telemetry IPC code. r=chutten 2017-02-15 16:25:40 +01:00
Sylvestre Ledru
684bd41226 Bug 1338086 - Remove useless else blocks in order to reduce complexity in toolkit/components/telemetry/ r=Dexter
MozReview-Commit-ID: EjMufQ1PReI
2017-02-09 10:52:55 +01:00
Georg Fritzsche
39492723eb Bug 1339365 - Move Histogram ID validity checks to outer API. r=chutten 2017-02-14 20:09:32 +01:00
Alessio Placitelli
f752c498c1 Bug 1278556 - Move the IPC timer logic to TelemetryIPCAccumulator.cpp. r=chutten
MozReview-Commit-ID: DSyFUM967F0
2017-01-16 05:10:00 +01:00
Alessio Placitelli
04015c8eae Bug 1315906 - Change JS histogram add functions so that it doesn't throw. r=gfritzsche 2016-12-20 08:32:00 +01:00
Sylvestre Ledru
0f65f2ab6c Bug 1318004 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11. r=Ehsan
MozReview-Commit-ID: lk5eJXUno9
2016-11-16 17:12:13 +01:00