Closed Bug 1180793 Opened 9 years ago Closed 9 years ago

[New Gaia Architecture][Metrics] Hud should report specific app for those Apps housed under "Communications"

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
FxOS-S6 (04Sep)
Tracking Status
firefox43 --- fixed

People

(Reporter: thills, Assigned: rnicoletti)

References

Details

Attachments

(1 file, 4 obsolete files)

Currently, contacts, phone, and SMS are all under the Communications App Manifest.  For more granular metrics reporting, it will be good have have the hud identify the sub-app vs. just "communications".
I have a patch for this I will be attaching shortly. I uses the frame's 'src' attribute to find the app name when the manifest "app name" is 'communications'
Assignee: nobody → rnicoletti
Status: NEW → ASSIGNED
Attachment #8651214 - Flags: feedback?(janx)
This is a rebased patch.
Attachment #8652054 - Flags: review?(janx)
Attachment #8651214 - Attachment is obsolete: true
Attachment #8651214 - Flags: feedback?(janx)
Comment on attachment 8652054 [details] [diff] [review]
properly report names of communications apps

Review of attachment 8652054 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks Russ! Just a few nits but they should be easy to fix.

::: b2g/chrome/content/devtools/hud.js
@@ +210,5 @@
>    },
>  
> +  get appName() {
> +
> +    if (!this._appName) {

Nit: Prefer bail-out style:

> if (this._appName) {
>   return this._appName;
> }
> // rest of code not indented

@@ -339,5 @@
>  
> -    if (!this.appName) {
> -      let manifest = this.manifest;
> -      if (!manifest) {
> -        return;

When there is no manifest, `_logHistogram()` used to return here instead of continuing.

You changed this behavior: Now when there is no manifest, `metric.appName` will just be set to `null` and the function will continue. Is this the new expected behavior?
Attachment #8652054 - Flags: review?(janx) → feedback+
Thanks for catching the change in behavior caused by my patch. That was unintentional. I'm now logging an error for that situation because I don't like silently failing.
Attachment #8652054 - Attachment is obsolete: true
Attachment #8652413 - Flags: review?(janx)
Comment on attachment 8652413 [details] [diff] [review]
properly report names of communications apps

Review of attachment 8652413 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me!

A few very minor nits: You can choose to address them now, or in a subsequent patch, but I'm OK with this patch as it is.

::: b2g/chrome/content/devtools/hud.js
@@ +217,5 @@
> +
> +    let manifest = this.manifest;
> +    if (!manifest) {
> +      let msg = DEVELOPER_HUD_LOG_PREFIX + ': Unable to determine app for telemetry metric. src: ' +
> +                this.frame.src; 

Nit: Trailing space.

@@ +218,5 @@
> +    let manifest = this.manifest;
> +    if (!manifest) {
> +      let msg = DEVELOPER_HUD_LOG_PREFIX + ': Unable to determine app for telemetry metric. src: ' +
> +                this.frame.src; 
> +      console.error(msg);

Nit: Maybe at some point all the prefixed `console.error()` calls could become a helper function? (e.g. `telemetryError()` or `developerHUD.logError()`) But it's fairly unimportant, we don't have to address this now.

@@ +386,5 @@
>          let keyed = Services.telemetry.getKeyedHistogramById(keyedMetricName);
>          if (keyed) {
>            keyed.add(metric.appName, parseInt(metric.value, 10));
>            developerHUD._histograms.add(keyedMetricName);
> +          telemetryDebug(keyedMetricName + ', ' + metric.value + ', ' + metric.appName);

Nit: If you don't care about commas, you could also log them this way: `telemetryDebug(keyedMetricName, metric.value, metric.appName)`, the proxied `console.log()` will separate these values with spaces, and won't have to coerce the values to a single string.
Attachment #8652413 - Flags: review?(janx) → review+
Updated patch, addressing final review nits

Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4bc4b4cc673c
Attachment #8652413 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/527c66668f40
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S6 (04Sep)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: