Commit Graph

58 Commits

Author SHA1 Message Date
Chris H-C
31f2359a9a bug 1463439 - Add a pref to enable 'event' ping. Defaults to true, except for GV. r=Dexter
When it's false we also disable collecting events completely, in case the
reason we're disabling it is due to storage issues.

GeckoView doesn't presently support Events, so the 'event' ping is disabled by
default for that platform.

MozReview-Commit-ID: 9eKAtRiuER0
2018-05-29 12:24:02 -04:00
Chris H-C
cd5fefdca9 bug 1460595 - Change storage semantics Telemetry Events r=Dexter
Instead of a hard cap, introduce a topic to notify when we reach the now-
preference-controlled per-process event record limit. Also add the capability
to leave some records behind in storage for the next call.

MozReview-Commit-ID: EY40tqKxxeW
2018-05-11 15:45:39 -04:00
Csoregi Natalia
f390145990 Merge inbound to mozilla-central. a=merge 2018-06-02 01:01:33 +03:00
Emilio Cobos Álvarez
4b8b5e1717 Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Jan-Erik Rediger
e3228b4e2c Bug 1463694 - Allow dynamic builtin events to overwrite existing events on registration. r=chutten
This means that during a normal "mach build faster" build all the events
will be overwritten, as the generated EventArtifactsDefinitions.json
contains all events from the Events.yaml it was generated from.

Real dynamic events follow similar code paths internally.
We also ensure they trigger the right code path and don't overwrite.

MozReview-Commit-ID: JvFZfwCbjQN
2018-05-29 16:05:56 +02:00
Jan-Erik Rediger
eede145b3a Bug 1463742 - Remove separate dynamic-builtin event storage. r=chutten,Dexter
Using a separate storage just for dynamic-builtin events was adopted
from the Scalar implementation of dynamic builtins, where the second
storage was needed because of the way IDs are constructed.
Events however use "category#method#object" for the key, making separate storage unnecessary.

Having that additional storage leads to problems along the way.
One of them is the snapshotter failing to properly accumulate from both storages
into a single array.
In addition, even if those are merged, an additional sort step would be
necessary to keep events ordered by time of occurence. And even then it
can't guarantee exact order for events from different storages but same
millisecond-time.

MozReview-Commit-ID: AefVyDRDqQB
2018-05-24 12:51:15 +02:00
Dorel Luca
fd18b8e657 Backed out 2 changesets (bug 1463742) for XPCShell failures on toolkit/components/telemetry/tests/unit/test_TelemetryChildEvents_buildFaster.js. CLOSED TREE
Backed out changeset ea1bc9529569 (bug 1463742)
Backed out changeset fce8e1904b18 (bug 1463742)
2018-05-28 18:21:31 +03:00
Jan-Erik Rediger
0c832e04fb Bug 1463742 - Remove separate dynamic-builtin event storage. r=chutten,Dexter
Using a separate storage just for dynamic-builtin events was adopted
from the Scalar implementation of dynamic builtins, where the second
storage was needed because of the way IDs are constructed.
Events however use "category#method#object" for the key, making separate storage unnecessary.

Having that additional storage leads to problems along the way.
One of them is the snapshotter failing to properly accumulate from both storages
into a single array.
In addition, even if those are merged, an additional sort step would be
necessary to keep events ordered by time of occurence. And even then it
can't guarantee exact order for events from different storages but same
millisecond-time.

MozReview-Commit-ID: AefVyDRDqQB
2018-05-24 12:51:15 +02:00
Jan-Erik Rediger
84c05ec400 Bug 1460400 - Don't enable dynamic builtin events on registration. r=chutten
This makes sure dynamic builtin events follow the same semantics as static builtin events.
On registration of the event the category is stored, but not enabled.
For fully-dynamic events, e.g. those registered by addons, the category
is enabled immediately (and can't be disabled).

This removes now-unused type definitions and switches from a map to a
simple set to store the category names.
The value stored in the map previously was not used at all.
In theory the map was effectively immutable after initialization, but
the check was only forced in debug anyway.
Now the set is mutable, but is only mutated in exactly 2 places.

MozReview-Commit-ID: 8tLEVXzHuHw
2018-05-14 12:31:30 +02:00
Jan-Erik Rediger
75eac0b3f7 Bug 1452552 - Add "products" property to events. r=Dexter
The "products" property is optional and defaults to `firefox, fennec`.
Recording of events is disabled if the probe doesn't have the products
property for the current running product.

MozReview-Commit-ID: EqTHq9duNT
2018-04-23 12:29:46 +02:00
Jan-Erik Rediger
4b94fa0f85 Bug 1448945 - Allow underscore in category, method and extra keys of event. r=chutten
According to the documnetation[1] category and method are identifiers,
thus an underscore is allowed. It's less clear for extra keys, but
underscores are already used there.

The documentation is adjusted accordingly.

[1]: https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/collection/events.html#limits

MozReview-Commit-ID: 9pUsDNXCY8m
2018-04-10 13:05:39 +02:00
Jan-Erik Rediger
69a37ef67d Bug 1448945 - Enable snapshotting dynamic builtin events. r=chutten
This additionally adds the memory consumption of dynamic builtin events
to the memory reporting.

MozReview-Commit-ID: LopWWPnWkBc
2018-04-09 15:06:30 +02:00
Jan-Erik Rediger
663a3b112b Bug 1448945 - Enable recording events in artifact builds without rebuilding Firefox. r=chutten
This patch enables the Firefox Telemetry core to register and record
to dynamic builtin scalars.

MozReview-Commit-ID: 8FeAgmmsQXw
2018-04-09 15:04:49 +02:00
Chris H-C
5b15bc62e2 bug 1440673 - Summarize events to a keyed scalar r=Dexter
Telemetry Events will now be counted in the keyed scalar
"telemetry.event_counts" even if their category is not enabled for recording.

The keys will be category#method#object and a follow-up commit will expand the
process limit of the number of these from 100 to 500, configurable by pref.

Unfortunately Event Telemetry needs a special API so that an event recorded in
multiple processes will be summarized to those processes separately.

MozReview-Commit-ID: 7dKcM3SXO6r
2018-03-16 15:56:16 -04:00
Chris H-C
3f94a518f5 bug 1450690 - Ensure extra_keys applies to more than just the first dynamic Telemetry Event r=Dexter,froydnj
(This is a partial revert of bug 1443587 part 2 where the `Move`s were added.)

When registering multiple methods and objects within the same `eventData` item,
we must copy the list of acceptable event keys into each new DynamicEventInfo.

Also includes a test.

MozReview-Commit-ID: 5PSH15nSWEB
2018-04-03 14:58:07 -04:00
Nathan Froyd
6d588d66b5 Bug 1443613 - don't allocate temporary strings for DNSRequestChild; r=mayhemer
DNSRequestChild's constructor takes `const nsCString&` parameters.  If
you have a `const nsACString&` argument to pass in to the constructor,
you're forced to construct a temporary nsCString object to satisfy the
prototype.  But the temporary string will just get copied inside the
constructor and you'll have to destroy the temporary string object you
created.

Let's skip all this, and just have DNSRequestChild take `const
nsACString&` arguments instead, and avoid the temporary object.
2018-03-07 12:22:03 -05:00
Nathan Froyd
8b87608a7f Bug 1443587 - part 5 - more efficient string serialization; r=chutten
The code for serializing an EventKey in SerializeEventsArray does
something peculiar: it creates a temporary array of nsCStrings, copies
the appropriate strings from the event info for the key, and then
converts those into JavaScript strings.  But we shouldn't need to do any
copying into the temporary array.  We can do everything directly on the
strings from the event info themselves.

It seemed best to introduce a ToJSString for this purpose, which comes
in handy in a couple other places as well.
2018-03-07 11:00:44 -05:00
Nathan Froyd
7ff41aef97 Bug 1443587 - part 4 - more efficient snapshot creation; r=chutten
Once we've created the array of events for a given process, there's no
need to copy it in the array for all process events.  We can Move() it
instead, which is more efficient.
2018-03-07 11:00:44 -05:00
Nathan Froyd
4fd36b063b Bug 1443587 - part 3 - don't copy ChildEventData; r=chutten
We were copying the event, rather than taking a reference to it.  Let's
do the latter instead of the former.
2018-03-07 11:00:44 -05:00
Nathan Froyd
ede5812d9b Bug 1443587 - part 2 - improve construction of DynamicEventInfos; r=chutten
When constructing DynamicEventInfo, we can require the extra keys to be
passed in by rvalue reference, rather than copying the entire array.
When registering dynamic events, we also don't need to construct an
entirely new nsCString to pass to the constructor; we can simply pass
the nsACString reference we received and go from there.
2018-03-07 11:00:44 -05:00
Nathan Froyd
307d115bba Bug 1443587 - part 1 - make EventInfo string getters return dependent strings; r=chutten
These methods are returning nsCString wrappers for static char arrays;
we only need to return nsDependentCStrings, rather than allocating and
copying entirely new nsCString objects.
2018-03-07 11:00:44 -05:00
rohan
7ff8aad929 Bug 1422035 - Make RegisterEvents assert on children processes. r=Dexter
MozReview-Commit-ID: AnItcTFejUH
2018-01-11 23:23:19 +05:30
Georg Fritzsche
44eb2bb7e2 Bug 1414638 - Remove expiry_date property for Telemetry events. r=dexter 2017-11-08 12:36:33 +01:00
Georg Fritzsche
2d741966e2 Bug 1408975 - Allow to register new addon events for an existing category. r=dexter 2017-11-08 12:36:33 +01:00
Sebastian Hengst
f6d132346f Backed out changeset 82a3eab8a078 (bug 1408975) for eslint failures in test_TelemetryEvents.js (dot notation). r=backout on a CLOSED TREE 2017-11-07 22:25:09 +02:00
Sebastian Hengst
5549711ca3 Backed out changeset a94b8078bb5c (bug 1414638) so bug 1408975 can be backed out. r=backout on a CLOSED TREE 2017-11-07 22:24:24 +02:00
Georg Fritzsche
e1b9821946 Bug 1414638 - Remove expiry_date property for Telemetry events. r=dexter 2017-11-07 20:33:24 +01:00
Georg Fritzsche
31aabe64de Bug 1408975 - Allow to register new addon events for an existing category. r=dexter 2017-11-07 20:33:24 +01:00
Alessio Placitelli
e24412e896 Bug 1393801 - Enable dynamic scalar registration. f=gfritzsche,r=billm,chutten
MozReview-Commit-ID: JlRk7hLV5QD
2017-08-29 13:05:40 +02:00
Georg Fritzsche
9385f14125 Bug 1302681 - Part 1: Extend Event Telemetry core for recording from addons. r=dexter
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.
2017-08-03 07:03: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
Nicholas Nethercote
c768a954ae Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00
Georg Fritzsche
49fd6d7993 Bug 1313326 - Part 5 - Use correct child event timestamps. r=dexter, f=chutten 2017-03-06 16:12:56 +01:00
Georg Fritzsche
d8b6b7d1e8 Bug 1313326 - Part 2 - Restrict event recording to specified processes. r=dexter 2017-03-06 16:12:49 +01:00
Georg Fritzsche
3b75819ee9 Bug 1313326 - Part 1 - Support recording events in child processes. r=dexter,froydnj 2017-02-14 14:43:51 +01:00
Sebastian Hengst
939e66513a Backed out changeset a6db4cae9990 (bug 1313326) for failing browser_UsageTelemetry_content.js on Linux x64 asan and debug (at least). r=backout on a CLOSED TREE 2017-03-01 19:48:09 +01:00
Sebastian Hengst
f464fc5724 Backed out changeset 223a0be48369 (bug 1313326) 2017-03-01 19:47:19 +01:00
Sebastian Hengst
b46669f4b3 Backed out changeset 49a7a91b73cc (bug 1313326) 2017-03-01 19:47:05 +01:00
Georg Fritzsche
845c7657c7 Bug 1313326 - Part 5: Use correct child event timestamps. r=dexter, f=chutten 2017-02-28 16:52:53 +01:00
Georg Fritzsche
ab4191da5a Bug 1313326 - Part 2: Restrict event recording to specified processes. r=dexter 2017-02-15 16:59:42 +01:00
Georg Fritzsche
75d3f1d9ef Bug 1313326 - Part 1: Support recording events in child processes. r=dexter, r=froydnj 2017-02-14 14:43:51 +01:00
Georg Fritzsche
2dacbb77e9 Bug 1329139 - Default event recording to disabled. r=dexter 2017-01-13 14:21:56 +07:00
Georg Fritzsche
320d864fe1 Bug 1316281 - Part 1 - Improve error message for unknown events. r=dexter 2016-12-02 12:17:12 +01:00
Georg Fritzsche
eb725e31b9 Bug 1316810 - Part 2 - Only serialize the events value & extra fields when needed. r=dexter 2016-12-02 12:17:12 +01:00
Georg Fritzsche
5c03e7d1cd Bug 1316810 - Part 1 - Use more strict size limits for event recording. r=dexter 2016-12-02 12:17:12 +01:00
Phil Ringnalda
6f651bae70 Backed out 5 changesets (bug 1316281, bug 1316810) for ASan failures in UsageTelemetry tests
Backed out changeset 2c711bb8e373 (bug 1316281)
Backed out changeset b3ea1334c33a (bug 1316281)
Backed out changeset 823e118b3fad (bug 1316281)
Backed out changeset 84e97301a8c9 (bug 1316810)
Backed out changeset f98ddece4b12 (bug 1316810)

MozReview-Commit-ID: 5tR2v8NWxQW
2016-12-01 07:46:00 -08:00