Closed Bug 837238 Opened 11 years ago Closed 11 years ago

Don't report session data in milliseconds

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file, 1 obsolete file)

Session data as implemented reports in milliseconds. The requirements spreadsheet specified seconds. Should we change data to seconds or leave in milliseconds?

Essentially the only time that will be changed is the total wall time of the session. IMO milliseconds shouldn't be too important here and we can throw them away. Another benefit of seconds over milliseconds is that milliseconds will overflow a 32 bit signed integer after 24.85 days. We don't have to worry about overflow if we store seconds.
Flags: needinfo?(deinspanjer)
Definitely go ahead and change to seconds.  I'd go so far as to says minutes, but I'd want buy in from an analyst before authorizing the change just for me.
Flags: needinfo?(deinspanjer) → needinfo?(sguha)
Seconds is great. Minutes is good, but the data becomes unnecessary more discrete. A lot of stat routines assume the data is generated by a continuous  process yet by reducing it to minutes our data will end up looking very discrete.
Flags: needinfo?(sguha)
Just in case i confused anyone, let's stay with seconds
While this technically breaks backwards compatibility, I think it is the easiest solution.

We now store seconds instead of milliseconds for the total time and only the total time. I could have stored seconds for start time as well, but meh. (We'd need migration code.)

I thought it was important to store seconds and not milliseconds in preferences because of concerns about 32 bit overflow with milliseconds. We still hold on to the raw milliseconds locally so we don't lose fragments due to rounding.

I also bumped the FHR measurement versions to signify a change in semantics.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Attachment #710369 - Flags: review?(rnewman)
qref
Attachment #710369 - Attachment is obsolete: true
Attachment #710369 - Flags: review?(rnewman)
Attachment #710372 - Flags: review?(rnewman)
Comment on attachment 710372 [details] [diff] [review]
Record total session time in seconds, v2

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

::: services/datareporting/sessions.jsm
@@ +121,4 @@
>      this._prefs.set("current.activeTicks", ++this._activeTicks);
>    },
>  
>    get totalTime() {

Add comment mentioning that this returns seconds.

::: services/datareporting/tests/xpcshell/test_session_recorder.js
@@ +71,5 @@
>  
> +  let oldTime = recorder.totalTime;
> +  yield sleep(1000);
> +  recorder.updateTotalTime();
> +  do_check_eq(recorder.totalTime - 1, oldTime);

This seems really fragile; I wouldn't want to count on the behavior of sleep being within the rounding range of a unit second.

Please instead modify recorder.startDate and re-run updateTotalTime.
Attachment #710372 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/d5390130b80e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services]
Target Milestone: --- → mozilla21
Component: Metrics and Firefox Health Report → Client: Desktop
Product: Mozilla Services → Firefox Health Report
Target Milestone: mozilla21 → Firefox 21
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: