selfspy / selfspy

Log everything you do on the computer, for statistics, future reference and all-around fun!
GNU General Public License v3.0
2.42k stars 230 forks source link

Strange report of stats.py --pactive #152

Open sarg opened 7 years ago

sarg commented 7 years ago

I am issuing command stats.py --pactive two times in a row and expect to see nearly the same result. The only difference should be that currently active window is increasing it's usage time by few seconds.

Instead I see that many windows are increasing theirs usage time.

Seems that the cutoff parameter is messing with the results.

~/devel/selfspy master*
❯ PYTHONPATH=. ./selfspy/stats.py -b 1 d --pactive 10       
cutoff  [10]
3945 keystrokes in 403 key sequences, 40 clicks (38 excluding scroll), 2651 mouse movements

Total time active: 39m 2s

Processes sorted by activity:
URxvt, 20m 6s
qutebrowser, 16m 48s
Emacs, 11m 38s
TelegramDesktop, 2m 10s
FocusProxy, 1m 56s

~/devel/selfspy master*
❯ PYTHONPATH=. ./selfspy/stats.py -b 1 d --pactive 100000000
cutoff  [100000000]
3947 keystrokes in 404 key sequences, 40 clicks (38 excluding scroll), 2651 mouse movements

Total time active: 15h 52m 57s

Processes sorted by activity:
URxvt, 15h 52m 57s
qutebrowser, 15h 51m 11s
Emacs, 15h 48m 52s
TelegramDesktop, 15h 45m 28s
FocusProxy, 24m 13s
jakecoble commented 7 years ago

Getting the same effect. My guess is that we're considered active in a window for cutoff seconds even after we've left it.

Are you using a tiling window manager? Your software seems similar to the software I use (st, luakit, Emacs, etc). If we're both using a tiling window manager, maybe that has something to do with it. Maybe flipping through windows, even if we don't stop to do anything in them, makes selfspy count that window as active, which would cause a bunch of windows to accrue more active time than they should.