Commit Graph

81 Commits

Author SHA1 Message Date
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
Wes Kocher
b620596e75 Backed out 4 changesets (bug 1318004) for xpcshell failures a=backout CLOSED TREE
Backed out changeset a3fe53641526 (bug 1318004)
Backed out changeset a5d1676b6f88 (bug 1318004)
Backed out changeset b56b37f0f4d7 (bug 1318004)
Backed out changeset fb5254baf1cb (bug 1318004)
2016-11-21 16:15:38 -08:00
Sylvestre Ledru
7ccbd595c5 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
Wes Kocher
13642ca8af Backed out 4 changesets (bug 1318004) for xpcshell failures a=backout
Backed out changeset 6995bd33872b (bug 1318004)
Backed out changeset 9be5c856bc78 (bug 1318004)
Backed out changeset 365b0b7f289a (bug 1318004)
Backed out changeset 2f2ebf176eac (bug 1318004)
2016-11-21 12:23:17 -08:00
Sylvestre Ledru
ea83e5e8bd 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
Chris H-C
9e6a6343c2 Bug 1314818 - Build fix: remove function erroneously included from 9f373cd98bab8e92ef5a0238edc9d50f8f2d5587 during rebase r=bustage-fix on a CLOSED TREE
MozReview-Commit-ID: 8HBHZ9MGBNv
---
 toolkit/components/telemetry/TelemetryHistogram.cpp | 10 ----------
 1 file changed, 10 deletions(-)
2016-11-09 11:14:47 -05:00
Chris H-C
161944f34d bug 1314818 - Get and dispatch telemetry accumulation to the main thread directly. r=froydnj
NS_DispatchToMainThread can fail catastrophically during shutdown. Simply
listening for shutdown isn't enough to prevent catastrophe. So directly fetch
the main thread and, if you can't, then don't try to use it.

MozReview-Commit-ID: 7iFQEqqQekB
2016-11-08 14:39:42 -05:00
Chris H-C
1084cecdbe bug 1314818 - Revert "bug 1304660 - Don't dispatch to main once xpcom starts shutting down." r=froydnj
This didn't quite work, as we still managed to try to dispatch during shutdown.

MozReview-Commit-ID: lnWoCrJUtu
2016-11-08 14:18:31 -05:00
AdamG2
fa1c11cef7 Bug 1300491 - Removed histogramFrom and resulting unused functions, all STARTUP_* histograms, and any tests using these. r=chutten
MozReview-Commit-ID: EnVYxGIOWgs
2016-11-07 15:13:01 -05:00
Chris H-C
8a091c3870 bug 1312778 - Ensure histogram recording is enabled before remote accumulation r=gfritzsche
There is a mechanism to selectively turn hgram recording off and on. This is
presently only used to throttle an otherwise-devastatingly-chatty hgram to only
contain accumulations from specific times (sync scroll).

This was only checked on the parent. This checks it on the child as well.

MozReview-Commit-ID: 4f0VXMHLaPW
2016-10-31 14:36:14 -04:00
David Anderson
c61aa58fc0 Send accumulated GPU process telemetry to the UI process. (bug 1304494 part 3, r=gfritzsche) 2016-10-30 22:35:57 -07:00
David Anderson
b63b7119f6 Refactor TelemetryHistogram to support multiple child process types. (bug 1304494 part 2, r=gfritzsche) 2016-10-30 22:35:57 -07:00
Sebastian Hengst
e87bad3294 Backed out changeset 4fb54b655a91 (bug 1300491) for build bustage in TelemetryHistogram.cpp (defined but not used). r=backout 2016-10-24 17:38:21 +02:00