Closed Bug 1071443 Opened 6 years ago Closed 6 years ago

[Telemetry] App usage data dropped after reboot

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: shinglyu, Assigned: marshall)

References

Details

(Whiteboard: ft:media)

Attachments

(2 files)

# Summary
  App usage data between the last upload and phone reboot is dropped. 

# Steps:
  - (optional) Change the app usage upload interval to 1 min.
  - Enable Wi-Fi or 3G, and enable app usage tracking in Settings > Improve B2G OS > Submit data
  - Use adb logcat and wait for the following message: "[AppUsage] Transmitted app usage data to <your server>".
  - Open the phone app, wait for 3 seconds and press the home key to go back to homescreen.
  - Reboot the phone before app usage is transmitted to the server again.
  - (If using Wi-Fi) Disable and re-enable Wi-Fi to trigger app usage transmission.
  - Check the app usage data on the server.

# Expected:
  - The phone app usage (3 seconds before reboot) should be included in the report uploaded after the reboot.
  - The start time of the report after reboot should be after or equal to the stop time of the report before the reboot.

# Actual:
  - The phone app usage is not in any report.
  - The start time of the report after reboot is before the stop time of the report before the reboot.

# Reproduction Frequency:
  Always
Please refer to the attachments for the logcat and server side data.
Flags: needinfo?(marshall)
[Blocking Requested - why for this release]:
blocking-b2g: --- → 2.1?
Depends on: 1070858
I was able to reproduce this locally, looking into it now
Flags: needinfo?(marshall)
Assignee: nobody → marshall
Component: Gaia → Gaia::System
Adding qawanted for branch checks.
Keywords: qawanted
Hema, can you do triage here?
Flags: needinfo?(hkoka)
Whiteboard: ft:media
I've been able to reproduce this a few times but the circumstances which it happens in are a little muddy. Here's what I know:

1) This seems to be caused by the fact that we only save app usage metrics when the device is idle. In this test, we are using a few apps, then rebooting, so the AUM service isn't given a chance to save the collected data.

2) The timestamps for startTime / stopTime seem to be pulled in some cases before the system clock gets synchronized, and AUM doesn't do anything to update it's measurements when that happens

I think we should probably block on this for at least #2. Losing data about actively used apps right before a reboot is definitely not ideal either, and probably merits a blocking nom on it's own..
I think that Marshall is correct above. In order to avoid regressing the startup time for apps, we don't persist new data until the phone has been idle for 5 seconds or something like that. If you reboot before you see the message 'Saved app usage data' then of course you will lose that data.

If the user is working furiously and the phone never becomes idle for 5 seconds, and maybe we could lose 2 minutes or so of data before a reboot.  But I think that is okay.

I recommend that we close this as RESOLVED/INVALID.  And maybe open a new bug for the issue #2 that Marshall identified above.
Flags: needinfo?(marshall)
Thanks David.  
Shing, please file a new bug against #2 in comment 7, and nominate that bug for blocking 2.1?.   We will resolve this bug as invalid since this is how its designed to be.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(slyu)
Resolution: --- → INVALID
cleaning keywords
Keywords: qawanted
Hi Marshall,

Can you provide the steps to reproduce the problem #2 in comment 7?
Thank you.

(In reply to Tony Chung [:tchung] from comment #9)
> Thanks David.  
> Shing, please file a new bug against #2 in comment 7, and nominate that bug
> for blocking 2.1?.   We will resolve this bug as invalid since this is how
> its designed to be.
Blocks: 1078120
See Also: → 1078120
Let's move the discussion to Bug 1078120.
(Let's move the discussion to Bug 1078120.)
Flags: needinfo?(slyu)
Flags: needinfo?(marshall)
blocking-b2g: 2.1? → ---
Flags: needinfo?(hkoka)
You need to log in before you can comment on or make changes to this bug.