-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add a test program to generate a test trace sent to Python report #71
Conversation
…into report_local
…into report_local Conflicts: py/reporter_service.py
…e index to trim to.
make the max. speed configurable.
…service, trace_attributes, then simulates a GPS trace along the route. Calls the Python report to generate a matched set of segments.
This includes a lot of other improvements: |
py/reporter_service.py
Outdated
datastore_out['reports'].append(report) | ||
else: | ||
#Log this as an error | ||
print("Speed exceeds 200kph") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sys.stderr.write()
maybe
py/reporter_service.py
Outdated
@@ -50,6 +51,24 @@ def serve_forever(self): | |||
def make_thread_locals(self): | |||
setattr(thread_local, 'segment_matcher', valhalla.SegmentMatcher()) | |||
|
|||
levels = "0,1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these four lines could be just:
setattr(thread_local, 'report_levels', set([ int(i) for i in os.environ.get('REPORT_LEVELS', '0,1').split(',')]))
same for the rest of these
py/reporter_service.py
Outdated
threshold_sec = bool(strtobool(str(os.environ.get('THRESHOLD_SEC')))) | ||
setattr(thread_local, 'threshold_sec', threshold_sec) | ||
|
||
provider = os.environ.get('PROVIDER', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the reporter wont be sending these to the datastore this is no longer needed. we'll be doing it in the java code
py/reporter_service.py
Outdated
data['datastore'] = datastore_out | ||
#Now we will send the whole segments on to the datastore | ||
if debug == False: | ||
if os.environ.get('DATASTORE_URL') and len(reports): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely remove this sending to the datastore
py/reporter_service.py
Outdated
segments['provider'] = thread_local.provider | ||
prior_segment_id = None | ||
first_seg = True | ||
datastore_out = dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datastore_out = {}
…ode will aggregate and send to Datastore.
Borrowed from @mxndrwgrdnr code to simulate a GPS trace from a Valhalla route.