Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

credit me idle time #192

Closed
anarcat opened this issue Oct 3, 2017 · 17 comments
Closed

credit me idle time #192

anarcat opened this issue Oct 3, 2017 · 17 comments

Comments

@anarcat
Copy link
Contributor

anarcat commented Oct 3, 2017

instead of suspending time tracking, safeeyes should credit me time that i am idle at the computer.

example: i'm due for a pause, safeeyes tells me so but postpone it. a few minutes later, i actually step away from the computer for 10 minutes. safeeyes consider that "idle time" so it stops tracking time. when i come back, safeeyes wakes up and sends me a warning after 5 minutes because I postponed the last break.

it should have counted my time away and if it was long enough to count as a break, count it as such.

@slgobinath
Copy link
Owner

Added with 395c0d0. If the idle time is less than the break time, it credits you the idle time. Otherwise, it schedules a new break.

@slgobinath
Copy link
Owner

Fixed and released in Safe Eyes 2.0.0

@anarcat
Copy link
Contributor Author

anarcat commented Oct 12, 2017

so i have tested this further, and i'm not sure it's fixed. here's an example debug log:

2017-10-12 16:56:57,597 [INFO]:[Thread-20] Waiting for 15 minutes until next break
2017-10-12 16:57:02,192 [INFO]:[Thread-2] Pause Safe Eyes due to system idle
2017-10-12 16:57:02,194 [INFO]:[MainThread] Disable Safe Eyes
2017-10-12 16:57:02,199 [INFO]:[MainThread] Stop Safe Eye core
2017-10-12 16:57:02,200 [INFO]:[Thread-20] Pre-break waiting is over
2017-10-12 17:04:35,492 [INFO]:[Thread-2] Resume Safe Eyes due to user activity
2017-10-12 17:04:35,494 [INFO]:[MainThread] Start Safe Eyes core
2017-10-12 17:04:35,495 [INFO]:[Thread-21] Update next break information
2017-10-12 17:04:35,497 [INFO]:[MainThread] Enable Safe Eyes
2017-10-12 17:04:35,500 [INFO]:[Thread-21] Waiting for 14 minutes until next break

there between at 16:57 and 17:04, i was away from the computer, completely idle. safeeyes noticed this and correctly suspended. however, when I came back it did not credit me the idle time - it said "waiting 14 minutes", instead of 15 minutes as it should have...

@anarcat
Copy link
Contributor Author

anarcat commented Oct 12, 2017

i would also mention it is not clear what the units are in the smart pause settings... minutes? seconds?

i would guess it is minutes because of 395c0d0#diff-ddaa06e551b01d46e15a6602f29bf48fR87 = but why minutes? why not seconds? it would seem better to have that more precise than less...

@slgobinath
Copy link
Owner

@anarcat thanks for pointing out the problem I will add the unit.

Nothing prevents from using seconds. I will add that too.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 14, 2017

should i file a new issue regarding the other problem?

@slgobinath
Copy link
Owner

not necessary. I'll just implement it :-)

@slgobinath
Copy link
Owner

Added with 8149f33

@anarcat
Copy link
Contributor Author

anarcat commented Oct 14, 2017

okay, so that adds second precision in the smart pause timer. but it still doesn't credit the user as I originally described. in other words, from what i can see in the patches (haven't tested post 2.0 code just yet), #192 (comment) still applies...

@slgobinath
Copy link
Owner

It does.
Suppose your next break is scheduled for 10.30 AM and you are idle for 5 minutes in between 10.20 - 10.25, you next break will be postponed to 10.35. (You are getting that extra 5 minutes) See(https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/plugins/smartpause/plugin.py#L118).

However, the maximum credit you can get is the break interval (by default 15 mins). I mean if you are idle for more than the break interval (say 1 hour), Safe Eyes will schedule the next break after 15 mins/whatever you have defined instead of postponing for 1 hour.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 14, 2017

so my argument is that this is backwards. if i need to take (say) 5 minute breaks every hour, being idle for 5 minutes should count as a 5 minute break. it should not just delay the break 5 minutes in the future, but actually give me a full 1h break before the next break.

in other words, in your example:

  • 5 minute breaks scheduled every hour
  • next break scheduled at 10h30AM
  • idle between 10h20 and 10h25AM
  • next break should be scheduled at 11h25AM, not 10h35AM

see what I mean?

@slgobinath
Copy link
Owner

Got it.
Now in the above scenario, if you were idle only 3 minutes, what should happen?

@slgobinath slgobinath reopened this Oct 14, 2017
@anarcat
Copy link
Contributor Author

anarcat commented Oct 14, 2017

the current situation: just suspend. the current behavior is correct in that regard.

so the "smart pause" case is:

  • 5 minute breaks scheduled every hour
  • next break scheduled at 10h30AM
  • idle between 10h20 and 10h23AM
  • next break should be scheduled at 10h38AM

that is correctly handled now, from what I understand.

the case that is not covered is, as I mentioned above:

  • 5 minute breaks scheduled every hour
  • next break scheduled at 10h30AM
  • idle between 10h20 and 10h25AM
  • next break should be scheduled at 11h25AM

so it's a threshold: when you are "idle", you suspend time tracking, but if you are idle enough, you count it as a break.

@slgobinath
Copy link
Owner

Got it.
Assume you take 15 seconds break every 15 minutes.
The current implementation starts a new break if you are idle for 15 minutes or more. If not, it postpones the break by the idle time.

What you ask is if you are idle for 15 seconds or more, you need to schedule a new break.

In a nutshell, your requirement is based on break duration but what I have implemented is based on the time between two breaks.

Is that what you mean?

@anarcat
Copy link
Contributor Author

anarcat commented Oct 14, 2017

yes, i believe it is. :)

@slgobinath
Copy link
Owner

Hi,
I came across an issue according to your suggestion. In my case, 15 seconds is my break duration but I don't want to interpret a 15 seconds system idle as a break because I want to do those exercises.
Therefore, I have added a new option Interpret idle time equivalent to upcoming break duration as a break.
If this option is enabled, then 15 seconds idle will schedule a new break. Otherwise, Safe Eyes will schedule a new break after 15 minutes (interval between two breaks) idle and credit back anything less than that.

WDYT?

@anarcat
Copy link
Contributor Author

anarcat commented Oct 17, 2017

makes sense, i'll test the latest code and will let you know!

slgobinath referenced this issue Oct 17, 2017
Currently translated at 100.0% (91 of 91 strings)

Translation: Safe Eyes/Translations
Translate-URL: https://hosted.weblate.org/projects/safe-eyes/translations/tr/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants