Persona is no longer an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 782468 - Implement Telemetry performance logging for SocialAPI
: Implement Telemetry performance logging for SocialAPI
Product: Firefox
Classification: Client Software
Component: SocialAPI (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: Firefox 17
Assigned To: :Felipe Gomes (needinfo me!)
: Shane Caraveo (:mixedpuppy)
Depends on:
  Show dependency treegraph
Reported: 2012-08-13 17:23 PDT by John Jensen
Modified: 2012-09-09 09:52 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (3.18 KB, patch)
2012-08-24 12:14 PDT, :Felipe Gomes (needinfo me!)
nfroyd: review+
mixedpuppy: review+
Details | Diff | Splinter Review

Description John Jensen 2012-08-13 17:23:17 PDT
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?
Comment 1 John Jensen 2012-08-23 16:18:02 PDT
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.
Comment 2 :Felipe Gomes (needinfo me!) 2012-08-24 12:14:36 PDT
Created attachment 655090 [details] [diff] [review]
Patch v1

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
Comment 3 Nathan Froyd [:froydnj] 2012-08-24 13:19:31 PDT
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.
Comment 4 :Felipe Gomes (needinfo me!) 2012-08-24 15:31:30 PDT
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
Comment 5 Shane Caraveo (:mixedpuppy) 2012-08-24 15:39:19 PDT
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.
Comment 6 :Felipe Gomes (needinfo me!) 2012-08-24 15:48:17 PDT
Yeah everEnabled is intended to be per-session, not persistent across them
Comment 7 :Felipe Gomes (needinfo me!) 2012-08-24 17:32:04 PDT
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
Comment 8 Ryan VanderMeulen [:RyanVM] 2012-08-25 08:47:27 PDT

Note You need to log in before you can comment on or make changes to this bug.