Closed Bug 1120992 Opened 10 years ago Closed 9 years ago

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

Categories

(Firefox Health Report Graveyard :: Client: Desktop, defect)

defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
Firefox 39
Tracking Status
firefox39 --- fixed

People

(Reporter: gfritzsche, Assigned: Dexter)

References

Details

(Whiteboard: [help])

Attachments

(1 file, 1 obsolete file)

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.
Blocks: 1137160
No longer blocks: 1120356
Summary: FHR data migration: org.mozilla.appSessions.current → Add totalTime (uptime in seconds) to the Telemetry session payload
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
Attached patch bug1120992.patch (obsolete) (deleted) — Splinter Review
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)
Attached patch bug1120992.patch - v2 (deleted) — Splinter Review
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
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [help][fixed-in-fx-team] → [help]
Target Milestone: --- → Firefox 39
Product: Firefox Health Report → Firefox Health Report Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: