Add totalTime (uptime in seconds) to the Telemetry session payload

RESOLVED FIXED in Firefox 39

Status

Firefox Health Report
Client: Desktop
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gfritzsche, Assigned: Dexter)

Tracking

Trunk
Firefox 39
Points:
---

Firefox Tracking Flags

(firefox39 fixed)

Details

(Whiteboard: [help])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

3 years ago
appSessions.current has the following data:
  startDay - is in Telemetry via nsIAppStartup.getStartupInfo().main timestamp
  activeTicks - is in Telemetry
  totalTime - integer seconds; we only have uptime so far, which is in minutes
  main - in Telemetry via nsIAppStartup.getStartupInfo()
  firstPaint - in Telemetry via nsIAppStartup.getStartupInfo()
  sessionRestored - in Telemetry via nsIAppStartup.getStartupInfo()

So, we only need to add totalTime to Telemetry for this.
(Reporter)

Updated

3 years ago
Blocks: 1137160
No longer blocks: 1120356
(Reporter)

Updated

3 years ago
Summary: FHR data migration: org.mozilla.appSessions.current → Add totalTime (uptime in seconds) to the Telemetry session payload
(Reporter)

Comment 1

3 years ago
We can just add totalTime to the session payload here:
https://hg.mozilla.org/mozilla-central/annotate/df3daecd381f/toolkit/components/telemetry/TelemetrySession.jsm#l579
... from sr.totalTime.
Whiteboard: [help]
Assignee: nobody → alessio.placitelli
Status: NEW → ASSIGNED
Created attachment 8571910 [details] [diff] [review]
bug1120992.patch

This patch adds the |totalTime| to the Telemetry Session payload.

Adds test coverage to |test_TelemetrySession.js|.
Attachment #8571910 - Flags: review?(vdjeric)
Comment on attachment 8571910 [details] [diff] [review]
bug1120992.patch

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

::: toolkit/components/telemetry/TelemetrySession.jsm
@@ +577,5 @@
>  
>        let sr = drs.getSessionRecorder();
>        if (sr) {
>          ret.activeTicks = sr.activeTicks;
> +        ret.totalTime = sr.totalTime;

You don't need to rely on the datareporting service for this, you can just do  Math.round((new Date() - si.process) / 1000) like we already do for minutes uptime
Attachment #8571910 - Flags: review?(vdjeric)
Created attachment 8572531 [details] [diff] [review]
bug1120992.patch - v2

Thank you for your time reviewing this, :vladan.

This patch computes totalTime as you suggested.
Attachment #8571910 - Attachment is obsolete: true
Attachment #8572531 - Flags: review?(vdjeric)
Comment on attachment 8572531 [details] [diff] [review]
bug1120992.patch - v2

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

::: toolkit/components/telemetry/TelemetrySession.jsm
@@ +495,3 @@
>      var ret = {
> +      totalTime: Math.round(elapsedTime / 1000), // totalTime, in seconds
> +      uptime: Math.round(elapsedTime / 60000) // uptime in minutes

heh these two measurements look kinda silly side-by-side, but let's keep both for now
Attachment #8572531 - Flags: review?(vdjeric) → review+
Yeah, they do :-/

That's the try push for this patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=efd9414f438e
The JP oranges also happen on similar jobs and do not seem to be related.
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/7b809001b656
Keywords: checkin-needed
Whiteboard: [help] → [help][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/7b809001b656
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Whiteboard: [help][fixed-in-fx-team] → [help]
Target Milestone: --- → Firefox 39
You need to log in before you can comment on or make changes to this bug.