classification as idle should start when idle begins, not when it reaches a threshold

Create issue
Issue #33 new
amenthes created an issue

I created a demo-logfile to illustrate my point.

I'm tagging activity / idle with these three rules:

$idle > 500 ==> tag inactive,
$idle > 500 ==> tag Activity:inactive,
tag Activity:active,

the first is the "special" tag used by arbtt internally, the second and third are what i'm actually using to draw active vs. inactive bars in my visualisation.

> dist\build\arbtt-dump\arbtt-dump.exe -f idle.log
2015-10-15 12:40:03 (15ms inactive):
... a few samples ...
2015-10-15 12:45:03 (15ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start
2015-10-15 12:46:03 (78ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: *C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start

[this is when i went away]

2015-10-15 12:47:03 (50217ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start
2015-10-15 12:48:03 (110231ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start
2015-10-15 12:49:03 (170229ms inactive):
-------8<-------
time passes
-------8<-------
2015-10-15 12:54:03 (470250ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start
2015-10-15 12:55:03 (530248ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start
2015-10-15 12:56:03 (590261ms inactive):
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Program Manager
    ( ) \Device\HarddiskVolume2\Tools\cmder\vendor\conemu-maximus5\ConEmu.exe: Cmder
    (*) \Device\HarddiskVolume2\Program Files (x86)\Notepad++\notepad++.exe: C:\temp\idletest.txt - Notepad++
    ( ) \Device\HarddiskVolume2\Windows\explorer.exe: Start

arbtt-stats outputs:

C:\...> dist\build\arbtt-stats\arbtt-stats.exe --logfile idle.log --intervals "inactive" --also-inactive
Intervals for category inactive
===============================
_____Tag_|______________From_|_____________Until_|_Duration_
inactive | 10/15/15 10:55:03 | 10/15/15 11:40:03 |   45m00s


C:\...> dist\build\arbtt-stats\arbtt-stats.exe --logfile idle.log --intervals "Activity:" --also-inactive
Intervals for category "Activity"
=================================
_____Tag_|______________From_|_____________Until_|_Duration_
  active | 10/15/15 10:40:03 | 10/15/15 10:55:03 |   15m00s
inactive | 10/15/15 10:55:03 | 10/15/15 11:40:03 |   45m00s

It categorizes all samples starting from 12:55 (10:55+02:00 timezone) as inactive. This is when (as you can tell from the dump), when $idle goes above 500(,000ms).

I would like to argue, that classification as idle would have to start at 12:47:03, or - even better - at 12:46:13 (12:47:03 minus its established 50217ms of inactivity). I know that classification looks only at a sample and certainly not ahead. This would also mean, that the state of a sample's classification is in flux until the idle time has passed.

Here's a small comparison of a timeline by arbtt (top) and manictime (bottom). Manictime has a minute grid, and mt does not, so slight differences are in order. I marked six instances where the machine got idle and where arbtt will classify idle time much later than i'd like it to be. MT has the approach of reclassifiying backwards to the point when the idle started.

mt-vs-arbtt-idle.png

If there is any workaround to achieve the same thing, I'll happily use that.

Comments (5)

  1. nomeata repo owner

    Indeed I believe that originally, I had this semantics for idle in mind, and a while the code was actually able to in principle look ahead and behind. But it was quite costly to do so, so at some point I dropped the possibility, analysing each sample on its own.

    Furthermore, the $idle tag is not built: It is just a custom tag that you can define in your categorize.cfg. This also stands in the way of a more advanced calculation (unless that is made very general as well).

    Also note that even with a tighter interpretation of idle, it will never be able to precisely know when you were working on something, as you might just be reading some documents.

  2. Log in to comment