Closed Bug 782468 Opened 9 years ago Closed 9 years ago

Implement Telemetry performance logging for SocialAPI


(Firefox Graveyard :: SocialAPI, defect)

Windows 7
Not set


(Not tracked)

Firefox 17


(Reporter: jjensen, Assigned: Felipe)


(Whiteboard: [Fx17])


(1 file)

In order to better understand the SocialAPI's performance in the field with testers and users, it would be useful to include, as part of the regular Telemetry pings for opted-in users, usage and performance data:

1) Whether social.enabled is True
2) Whether is True
3) Time taken for all content in sidebar to load
... others?
Whiteboard: [Fx17]
Assignee: nobody → felipc
Hi Felipe, thanks for taking this one on. Feel free to ping me any time if you have any questions or I can help in any way.
Attached patch Patch v1Splinter Review
So this patch implements two different measurements in order to get a better sense of the feature usage. They are:

- A histogram that reports if the feature has been ever enabled in the current browser session (i.e. no restart). It won't report twice if the feature is disabled and re-enabled. It will have a bias towards people who restart the browser often.

- A histogram that reports when the feature is either turned on or off. Launching the browser with the feature already on will *not* report in this histogram, on purpose. It will have a bias towards people toggling on/off often.

I'm not a statistics person but I believe that these two combined will give a better understanding of the usage than any of those alone. For the first one, I was simply gonna measure if the feature was enabled on startup, but that would fail in cases when users disable that every time before shutdown (which isn't a rare usage pattern, I think)

Any feedback is appreciated
Attachment #655090 - Flags: review?(nfroyd)
Comment on attachment 655090 [details] [diff] [review]
Patch v1

Review of attachment 655090 [details] [diff] [review]:

::: toolkit/components/telemetry/TelemetryHistograms.h
@@ +536,5 @@
> +/**
> + * Social Telemetry
> + */
> +HISTOGRAM_FLAG(SOCIAL_ENABLED_ON_SESSION, "Social has been enabled at least once on the current session")
> +HISTOGRAM_BOOLEAN(SOCIAL_TOGGLED, "Social has been toggled to on or off")

Please note that TelemertyHistograms.h has been deleted on inbound via bug 781531.  Assuming it sticks, you'll have to add these definitions to Histograms.json.  It should be straightforward to do the translation; please ping me if you have questions.
Attachment #655090 - Flags: review?(nfroyd) → review+
Comment on attachment 655090 [details] [diff] [review]
Patch v1

Getting extra review from Shane to take a look at where I added the reporting for these telemetry probes
Attachment #655090 - Flags: review?(mixedpuppy)
Comment on attachment 655090 [details] [diff] [review]
Patch v1

>diff --git a/toolkit/components/social/MozSocialAPI.jsm b/toolkit/components/social/MozSocialAPI.jsm
>--- a/toolkit/components/social/MozSocialAPI.jsm
>+++ b/toolkit/components/social/MozSocialAPI.jsm
>@@ -8,25 +8,32 @@ Cu.import("resource://gre/modules/Servic

> var MozSocialAPI = {
>   _enabled: false,
>+  _everEnabled: false,
>   set enabled(val) {
>     let enable = !!val;
>     if (enable == this._enabled) {
>       return;
>     }
>     this._enabled = enable;
>     if (enable) {
>       Services.obs.addObserver(injectController, "document-element-inserted", false);
>+      if (!this._everEnabled) {
>+        this._everEnabled = true;
>+        Services.telemetry.getHistogramById("SOCIAL_ENABLED_ON_SESSION").add(true);
>+      }

is everEnabled supposed to be persistent across firefox sessions?  If it is only per-session, this is fine.
Attachment #655090 - Flags: review?(mixedpuppy) → review+
Yeah everEnabled is intended to be per-session, not persistent across them
Landed the enabled/toggled telemetry, described on comment 2:

John, let's keep this bug about these two probes landed, and open new bugs for more telemetry measurements once it's figured out what and how to measure them
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.