-
Notifications
You must be signed in to change notification settings - Fork 9
Additional sleep analysis support for non-aggregated data #6
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
Conversation
- add startDate and endDate which is only included in sleep analysis when it is not aggregated (toggle switch in health auto export) - use reflection to determine which fields to not duplicate in DatapointFields (since this adds 2 new fields to track)
…, deep, rem, awake)
- non-aggregated sleep data data points are stored with startDate = 1 and endDate = 0 in influx, at the correct times - json marshal/unmarshal for Metric was modified to store sleep_analysis data in the SleepAnalyses field - undo initial attempt with added fields to Metric, which didn't have enough information as fields were used but tags are needed
Codecov ReportBase: 71.69% // Head: 69.63% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
==========================================
- Coverage 71.69% 69.63% -2.06%
==========================================
Files 7 7
Lines 537 606 +69
==========================================
+ Hits 385 422 +37
- Misses 121 148 +27
- Partials 31 36 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
@tedpearson I've added a few integration tests and also refactored the test fixtures a bit, so there's now a merge conflict on your branch. You can take a look at the changes at #7, and I'm thinking you could also add some integration tests for the expected line protocol data for the new Thank you! |
|
Conflicts resolved. Waiting for feedback on test fixtures before proceeding. :) |
|
Thanks @tedpearson for your dedication to this! I've addressed your comments above 😄 |
…jsonMetric. Also change Metric.Data to Metric.Datapoint to show intention to be application level field.
|
TBD: integration tests. |
|
Integration tests added! |
irvinlim
left a comment
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.
Amazing work, just some remaining points of discussion. Rest LGTM! 😄
…egated) - Instead of debug level logging influx measurement name, now just log the metric name as it is simpler when creating different metrics.
|
LGTM! Thanks for the amazing work 😄 |
Hey Irvin, here's the new PR I promised:
qtyandstatesource(e.g. watch/phone/app) andvalue(sleep stage, asleep, awake, inBed)1atstartDateand0atendDateSleepAnalysisstruct to hold structured non-aggregate sleep dataActual sleep metrics from my last night, powered by these changes, from my Grafana (my database is actually Victoriametrics, not Influx):
