GithubHelp home page GithubHelp logo

hkanalyser's People

Contributors

dmeehan1968 avatar

Watchers

 avatar  avatar

hkanalyser's Issues

streamToMongoDb fails if no records in input

Steps to reproduce

  1. Create zero length input file
  2. Pass input to streamToMongoDb
  3. streamToMongoDB attempts to dbConnection.close() but the connection is only created after first record encountered (await connect())

Observations

  1. streamToMongoDb resets the connection after use, replacing it with an empty object rather than null, invalidating other tests for truthiness

  2. streamToMongoDb is a singleton

Desired Analysis Types

  • Min/Max/Avg Heart Rate whilst sleeping
  • Min/Max/Avg Heart Rate during workout (by workout type)
  • Min/Max/Avg Heart Rate whilst step count incrementing (over low water mark)
  • Min/Max/Avg Heart Rate whilst awake but inactive
  • Walking/Running pace per interval

CSV Import

Heart Rate (from QS Access)

Start,Finish,Heart Rate (count/min)
04-Jul-2015 13:24,04-Jul-2015 13:24,51.0
04-Jul-2015 14:04,04-Jul-2015 14:04,69.0
04-Jul-2015 14:44,04-Jul-2015 14:44,61.0
04-Jul-2015 15:54,04-Jul-2015 15:54,62.0
[
  {
    "start": "2015-07-04 13:24",
    "end": "2015-07-04 13:24",
    "heartRate": 51
  },
]  

Sleep Analysis (from QS Access)

In bed start,In bed Finish,Minutes in bed,Minutes asleep,Time to fall sleep,Number of sleep periods,Sleep 1 start,Sleep 1 finish,Sleep 2 start,Sleep 2 finish,Sleep 3 start,Sleep 3 finish,Sleep 4 start,Sleep 4 finish,Sleep 5 start,Sleep 5 finish,Sleep 6 start,Sleep 6 finish,Sleep 7 start,Sleep 7 finish,Sleep 8 start,Sleep 8 finish,Sleep 9 start,Sleep 9 finish
27-Oct-2015 00:14,27-Oct-2015 07:44,449.972628450394,0.0,0.0,0
28-Oct-2015 00:38,28-Oct-2015 08:04,445.457782999674,0.0,0.0,0
29-Oct-2015 00:24,29-Oct-2015 07:38,433.558566383521,0.0,0.0,0
30-Oct-2015 00:20,30-Oct-2015 06:11,351.11345791618,351.11345791618,0.0,1,30-Oct-2015 00:20,30-Oct-2015 06:11
30-Oct-2015 23:59,31-Oct-2015 07:25,445.414388566216,445.414388566216,0.0,1,30-Oct-2015 23:59,31-Oct-2015 07:25
[
  {
    "start": "2015-10-30 00:20",
    "end": "2015-10-30 06:11",
    "inBed": 351.11345791618,
    "asleep": 351.11345791618,
    "timeToSleep": 0.0,
    "sleepPeriods": [
      {
        "start": "2015-10-30 00:20",
        "end": "2015-10-30 06:11"
      }
    ]
  }
]

Steps

Start,Finish,Steps (count)
11-Sep-2014 14:27,11-Sep-2014 14:27,12.0
11-Sep-2014 14:47,11-Sep-2014 14:47,21.0
11-Sep-2014 14:52,11-Sep-2014 14:52,439.0
11-Sep-2014 14:57,11-Sep-2014 14:57,476.0
11-Sep-2014 15:02,11-Sep-2014 15:02,881.0
[
  {
    "start": "2014-09-11 14:27",
    "end": "2014-09-11 14:27",
    "heartRate": 12
  },
]  

streamToMongoDb fails if batchSize > 1

Observations

streamToMongoDb has a config option batchSize which defaults to one. It accumulates records to be written to mongo until batchSize is reached, then inserts as a batch. If this value is greater than 1, the application seems to block after outputting 16 records (if on('data', ...) is used to track records passed from csvtojson.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.