Clarification around data.days entries
Richard Newman
rnewman at mozilla.com
Mon Mar 3 18:01:26 PST 2014
> A few of us have been discussing how data.days works, and we want to be sure we understand it correctly and that we've given everyone an opportunity to flag any potential nuances in the behavior. GPS and rnewman (or whoever gets there first) can you confirm for desktop and Fennec respectively that:
>
> * Any calendar day on which an instance is active will have an entry in data.days, even if the activity is from a sessions that started many days ago?
Fennec:
Any calendar day on which an instance records an event will have an entry in data.days.
If you start a session on Fennec on Monday and do nothing until Wednesday, then hit Home:
* Monday's upload will have no entry for Monday.
* Tuesday's will have one entry for Monday: the successful upload.
* Wednesday's upload will have a single session entry for Monday (with a very long duration), upload entries for Monday and Tuesday, and nothing for Wednesday.
Note that if the phone for some reason doesn't attempt an upload on Tuesday, there will be no entry at all for Tuesday.
> * If there is no new data for a particular day (i.e., no new bookmarks, no searches, no environment changes of any sort), what is the required set of entries that will always be included for all days (addons.counts, places.places, appInfo.appinfo, etc?)
The only things that Fennec records as dated events are searches, sessions, and uploads. There are no daily data items in Fennec -- those things are all part of the environment. If the environment doesn't change, and you don't do anything with the browser, the only recorded activity will be upload attempts.
> * The client uses UTC to determine the calendar date on which activity has occurred (ignoring clock skew).
Yes. More accurately, we supply the number of integer completed days since Jan 1 1970 00:00:00 UTC.
public static int getDay(final long time) {
return (int) Math.floor(time / GlobalConstants.MILLISECONDS_PER_DAY);
}
> * appSessions is recorded on the date a session starts and only on that date, including long sessions that run across multiple calendar dates.
Fennec records sessions when they *finish*, but attributes them retrospectively to the date on which the session began.
> We're basically trying to double-check our understanding the that we can get a accurate count of all the active FF instances on a given date by just counting up all the data.day entries present on that date (orphaning and clock skew aside). If there's any nuance we're missing here, please let us know.
If you want active Fennec instances, you need to look for dates on which a session began. If you include all days with any activity at all, you'll be including devices that are uploading reports with only uploader events, even if the user isn't browsing.
IIRC we try not to upload unless the user used the browser since our last upload, but you can tell me whether that works!
If you want to be really thorough, you also need to include dates on which no session began, but for which a previous session's extent includes the non-sessioned date: that is, where a previous session's "d" field is greater than 86400 (with the appropriate extension for multiple days, and the obvious caveat that we don't have enough precision to be accurate here).
I expect multi-day sessions to be rare enough to be ignorable.
More information about the fhr-dev
mailing list