mirror to self-port
Merge branch 'master' of https://github.com/RichardCao/adaptive-monitor
works but functions error