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

Event Counter #53

Open
SSPW opened this issue Mar 22, 2016 · 1 comment
Open

Event Counter #53

SSPW opened this issue Mar 22, 2016 · 1 comment

Comments

@SSPW
Copy link

SSPW commented Mar 22, 2016

After playing with /api/v1/monitor for external clients, i think either the client interface should be rebuilt (see #49) or alternatively a new value should be created and added to the existing interface.

The /api/v1/monitor JSON response currently looks like this;
monitorjson

Suggestion:

  1. add a global gate event counter to the app (if it doesn't already exist)
  2. this gate event counter is reset to zero at the start of a new race
  3. this gate event counter is incremented with each decoded transponder event
  4. this gate event counter is added to the session structure sent via the api
  5. add gate event count to each data structure sent via the api

This would allow much faster processing by clients. The client can compare the last_gate_event_count it is holding to the gate_event_count of a new response. If new count its less than the last count, its a new race. It count increases, then the pilot data in the response needs to be processed. Looping through data structures, checking if item gate_event_count > client_last_update_count, tells you processes that pilot or not.

There might already be a unique id for gate events in the database. If this is a simple incremental index, then it just need to be added to the api.

@polyvision
Copy link
Owner

that's a good suggestion. I'll add it to the todo list

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