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

TimelineRecorder / TimelineSegment #11

Open
10 of 12 tasks
sobri909 opened this issue Apr 29, 2018 · 0 comments
Open
10 of 12 tasks

TimelineRecorder / TimelineSegment #11

sobri909 opened this issue Apr 29, 2018 · 0 comments
Assignees
Milestone

Comments

@sobri909
Copy link
Owner

sobri909 commented Apr 29, 2018

This is an issue to track development on the new managers / stores architecture for the next major release.

db -> store -> recorder / segment / processor

public TimelineRecorder (new)

TimelineRecorder will take over the jobs of a) communicating with LocomotionManager, and b) creating new timeline items.

The Recorder does not do any Item processing. It records new Samples and new TimelineItems, using the existing logic for whether to continue the current Item or create a new Item (ie on stationary/moving state changes, and activityType changes).

This division of labour keeps the Recorder simple and focused, and makes it easier to separate the Item processing loop from the recording loop. Which should hopefully allow for more battery efficient recording, by way of delaying Item processing until a point in time where it becomes necessary (eg sleep mode is about to start; some UI wants to show processed items to the user; etc).

public TimelineSegment (new)

TimelineSegment adds functionality for fetching of TimelineItems within specified date ranges. It will also internally manage the processing of these Items (by making use of TimelineProcessor) so that the resulting Items set is coherent and human presentable (as compared to the raw unprocessed Items produced by Recorder).

public TimelineProcessor (new)

TimelineProcessor takes over the internal job of processing (merging, edge cleansing, safe deleting, etc) sequential Items.

TimelineManager

TimelineManager will be removed. The new classes take over all of its responsibilities, so it will be made redundant.

Misc todos

  • Make these classes final, no subclassing (only stores should be custom)
  • Only one Recorder per Store
  • Can have multiple overlapping Segments
  • Segments are created by giving a date range or SQL query
  • Should probably move Arc App's edge healing to LocoKit
  • Should probably move Arc App's data gap insertion to LocoKit
  • Fix the mystery broken item edges that aren't broken at heal time
  • Persistent store needs to add a data gap at startup

Todos for the plain (non persistent) TimelineManager

Non persistent stores are no longer supported 😞

  • Need a replacement for finalisedTimelineItem
  • ~Non persistent store needs to know which items to retain for active item processing~~

Testing todos

  • Stress test in the Demo App
  • Road test in a public Arc App release

Docs todos

  • Write the API docs
  • Write up some example code snippets
@sobri909 sobri909 self-assigned this Apr 29, 2018
@sobri909 sobri909 mentioned this issue May 2, 2018
29 tasks
sobri909 added a commit that referenced this issue May 2, 2018
sobri909 added a commit that referenced this issue May 2, 2018
sobri909 added a commit that referenced this issue May 5, 2018
…h cycle, not from the initial specified item (which might've disappeared) #11
sobri909 added a commit that referenced this issue May 8, 2018
sobri909 added a commit that referenced this issue May 9, 2018
sobri909 added a commit that referenced this issue May 9, 2018
…g to sleep, not on every wakeup -> sleep transition #11
sobri909 added a commit that referenced this issue May 10, 2018
sobri909 added a commit that referenced this issue May 10, 2018
sobri909 added a commit that referenced this issue May 11, 2018
sobri909 added a commit that referenced this issue May 11, 2018
…eue. and add more delay before notifying on updates #11
sobri909 added a commit that referenced this issue May 11, 2018
sobri909 added a commit that referenced this issue May 17, 2018
… when in background, to avoid wasteful processing) #11
sobri909 added a commit that referenced this issue May 18, 2018
sobri909 added a commit that referenced this issue May 22, 2018
sobri909 added a commit that referenced this issue May 28, 2018
sobri909 added a commit that referenced this issue May 29, 2018
sobri909 added a commit that referenced this issue May 29, 2018
@sobri909 sobri909 added this to the 6.0.0 milestone May 29, 2018
sobri909 added a commit that referenced this issue May 29, 2018
…touch item.samples, to avoid sql selects inside db save transactions #11
sobri909 added a commit that referenced this issue May 30, 2018
sobri909 added a commit that referenced this issue May 30, 2018
…e a fetch of them on access, instead of waiting #11
sobri909 added a commit that referenced this issue May 31, 2018
…e loop of reclassifying. so let's not nil the items array #11
sobri909 added a commit that referenced this issue May 31, 2018
sobri909 added a commit that referenced this issue May 31, 2018
sobri909 added a commit that referenced this issue Jun 3, 2018
sobri909 added a commit that referenced this issue Jun 4, 2018
…neSegments can be hammering it from separate threads #11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant