Skip to content

Support for multiple reroute metric collection - #348

Merged
cammace merged 10 commits into
release-0.6.3from
cam-never-clear-ringbuffer
Oct 17, 2017
Merged

cammace merged 10 commits into
release-0.6.3from
cam-never-clear-ringbuffer

Conversation

@cammace

@cammace cammace commented Oct 10, 2017 •

Copy link
Copy Markdown

Closes #336

Adds a queue and uses main thread to check the timing of when to send the event.

@cammace cammace added bug Defect to be fixed. navigation-core labels Oct 10, 2017
@cammace cammace added this to the v0.6.3 milestone Oct 10, 2017
@cammace cammace self-assigned this Oct 10, 2017

@ericrwolfe ericrwolfe left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good save for the following comments.

mapboxNavigation.setSessionState(mapboxNavigation.getSessionState().toBuilder()
.routeProgressBeforeReroute(routeProgress)
.beforeRerouteLocations(Arrays.asList(
locationBuffer.toArray(new Location[locationBuffer.size()])))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this set ~40 beforeRerouteLocations?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Originally, I set this up similar to how iOS was handling this but I found that filtering based on time would be less efficient than simply storing an array of before and after location updates like we were previously doing. Essentially, when a reroute event occurs we capture a "snapshot" of the session state and hold onto it for ~20 seconds, add the after reroute locations and then push the event.

}

void sendRerouteEvent(SessionState sessionState) {
mapboxNavigation.setSessionState(sessionState.toBuilder()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By capturing the session state at the time of reroute, how do we capture and send up the new geometry, etc associated resulting from the reroute?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cammace
cammace force-pushed the cam-never-clear-ringbuffer branch from fcc0099 to 0a0dd10 Compare October 12, 2017 18:25
@ericrwolfe
ericrwolfe changed the base branch from master to release-0.6.3 October 12, 2017 22:39
@zugaldia zugaldia mentioned this pull request Oct 16, 2017
11 tasks done
@cammace

cammace commented Oct 17, 2017

Copy link
Copy Markdown
Author

All looks good and correct to me, going ahead and merging.

@cammace
cammace merged commit a9b6135 into release-0.6.3 Oct 17, 2017
@cammace
cammace deleted the cam-never-clear-ringbuffer branch October 17, 2017 13:46
@cammace cammace mentioned this pull request Oct 17, 2017
7 of 9 tasks
return new Location[0];
}
// Reverse the list order to conform with the spec
Collections.reverse(locations);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still necessary since locations are added with addLast() instead of push()?

.beforeRerouteLocations(Arrays.asList(
locationBuffer.toArray(new Location[locationBuffer.size()])))
.routeProgressBeforeReroute(routeProgress)
.lastRerouteDate(new Date())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this cause SessionState.timeFromLastReroute() to take the diff from the current reroute date rather than the previous reroute date?

return -1;
}
long diffInMs = lastRerouteDate().getTime() - new Date().getTime();
long diffInMs = new Date().getTime() - lastRerouteDate().getTime();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SessionState.secondsSinceLastReroute() is called during Telemetry.pushEvent() which happens ~20s after the original reroute event. Since we're using new Date() here, that means secondsSinceLastReroute is computed as the seconds from the send event to the lastRerouteDate, rather than the seconds from the original reroute time to the last reroute date.

See also my comment above (https://github.com/mapbox/mapbox-navigation-android/pull/348/files#r145172948) about storing the last reroute date.

@cammace cammace mentioned this pull request Oct 17, 2017
cammace pushed a commit that referenced this pull request Oct 19, 2017
* Do not allow rotation for Nav UI (#377)

* Support for multiple reroute metric collection (#348)

* capture sessionState and add to queue when reroute occurs

* Resolved several issues which related to location

* fix checkstyle for NavigationMetricsWrapper

* enable extra logging in debug mode

* add option to log telemetry requests when debug mode is enabled

* seconds no null anymore

* make SessionState fields unique

* add test for ringbuffer peak methods

* create a copy of the location object when snapping a location

* make sure the buffer keeps adding fresh values

* Avoids out of bounds exception in addTrafficToSource() (#384)

* avoids out of bounds exception

* added index out of bounds exception

* Undo throwing exception

* force git to push

* Updated changelog and readme

* More reroute fixes (#389)

* removed collection reverse

* fix lastrerouteseconds

* set the queued reroute events to represent new values

* checkstyle

* fixed total distance completed not getting set

* make sure that the reroute event includes the reroute time as the created timestamp (#398)

* temporarily change circle ci publish branch

* [android] [auto] Update properties to version 0.6.3 in preparation for build.

* change circleci script back to using master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Defect to be fixed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants