Enhance time-spent tracking

Summary:
Previously, at 1-minute intervals, if the flipper window was focused on, it would report the currently active plugin.
We'd sum all those "ping" events and that would approximate the number of full minutes spent in total across all users.
It's quite coarse grained, if you're focused on the window for 30 seconds, there's a 50% change your ping will get used.
While being reasonable across many users, it doesn't allow analysis like how many plugins do people typically use in a session, because we probably won't see all the plugins they use.

New approach, for every minute flipper is open, report the focused and unfocused time spent in each plugin, as well as the total across all plugins.
This should give us the previous data but with much more precision.

Should be especially helpful for plugins with low numbers of users, you typically interact with emulators while using a plugin, so it's not continually in focus, so you miss a lot of usage events.

enhance_bladerunner

Reviewed By: nikoant

Differential Revision: D19392796

fbshipit-source-id: af9244e993edff9b381144ca587c3a77fdf8c98a
This commit is contained in:
John Knox
2020-01-14 10:25:52 -08:00
committed by Facebook Github Bot
parent 84302f109b
commit a96931c43f
9 changed files with 380 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ let filePath = argv.file;
// tracking
setInterval(() => {
if (win && win.isFocused()) {
if (win) {
win.webContents.send('trackUsage');
}
}, 60 * 1000);