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

Inactivity device based on speed and location. #25

Open
Jeferex opened this Issue Nov 11, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@Jeferex
Contributor

Jeferex commented Nov 11, 2014

One thing I think should be improved is Inactivity. By default, a device is considered inactive when speed is <= 0 but I have some devices that always send speed = 0 so they are considered inactive even though they are moving. So I think, to consider a device inactive, speed and location should be considered.

@vitalidze

This comment has been minimized.

Show comment
Hide comment
@vitalidze

vitalidze Nov 29, 2014

Owner

I am thinking about this issue for several days and can't find a scalable way of implementing it. The main hardness is to find out previous non-idle position when user logs in. For speed it is found with single simple SQL query, but for location it cannot be done with simple query because it requires to look into previous position. So it either requires additional JOIN of same positions table, or user-defined variables (works for MySQL and H2, but not for PostgreSQL), or load all data in memory and then filter programmatically in java. All these options scale badly if amount of data grows, and I'm out of ideas.

Maybe there are any other thoughts of this feature implementation?

I am thinking about adding a check box to just allow to disable this 'idle' calculation for devices that don't send speed as a surrender solution.

Owner

vitalidze commented Nov 29, 2014

I am thinking about this issue for several days and can't find a scalable way of implementing it. The main hardness is to find out previous non-idle position when user logs in. For speed it is found with single simple SQL query, but for location it cannot be done with simple query because it requires to look into previous position. So it either requires additional JOIN of same positions table, or user-defined variables (works for MySQL and H2, but not for PostgreSQL), or load all data in memory and then filter programmatically in java. All these options scale badly if amount of data grows, and I'm out of ideas.

Maybe there are any other thoughts of this feature implementation?

I am thinking about adding a check box to just allow to disable this 'idle' calculation for devices that don't send speed as a surrender solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment