# HG changeset patch # User drewp # Date 1555828829 25200 # Node ID 73b6ed12bae67835705e32d291bee0f67617c834 # Parent 42f333f7d088f54165d2c2dfd44dbe297d70312c stats handler, events output fix, build updaets Ignore-this: 3f2d695e0e49e8be8084017de08b0539 darcs-hash:d6243c6c3484793b4e1c0e7ce359d551dad4cd07 diff -r 42f333f7d088 -r 73b6ed12bae6 service/piNode/makefile --- a/service/piNode/makefile Sat Apr 20 23:39:45 2019 -0700 +++ b/service/piNode/makefile Sat Apr 20 23:40:29 2019 -0700 @@ -15,3 +15,6 @@ push_config: docker run -it --net=host -v `pwd`/config:/opt/config bang6:5000/arduino_node python pushConfig.py pi/ + +redeploy: build_image + sudo /my/proj/ansible/playbook -l pi -t raspi_io_node diff -r 42f333f7d088 -r 73b6ed12bae6 service/piNode/piNode.py --- a/service/piNode/piNode.py Sat Apr 20 23:39:45 2019 -0700 +++ b/service/piNode/piNode.py Sat Apr 20 23:40:29 2019 -0700 @@ -8,6 +8,8 @@ from twisted.internet.threads import deferToThread from docopt import docopt import etcd3 +from greplin import scales +from greplin.scales.cyclonehandler import StatsHandler logging.basicConfig(level=logging.DEBUG) @@ -37,6 +39,8 @@ hostname = socket.gethostname() CTX = ROOM['pi/%s' % hostname] +STATS = scales.collection('/root', +) def patchRandid(): """ I'm concerned urandom is slow on raspberry pi, and I'm adding to @@ -306,12 +310,13 @@ (r"/()", cyclone.web.StaticFileHandler, { "path": "static", "default_filename": "index.html"}), (r'/static/(.*)', cyclone.web.StaticFileHandler, {"path": "static"}), + (r'/stats/(.*)', StatsHandler, {'serverName': 'piNode'}), (r'/boards', Boards), (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}), (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}), (r'/output', OutputPage), (r'/dot', Dot), - ], config=config, debug=arg['-v']), interface='::') + ], config=config, debug=arg['-v']), interface='::') log.warn('serving on 9059') reactor.run() diff -r 42f333f7d088 -r 73b6ed12bae6 service/piNode/requirements.txt --- a/service/piNode/requirements.txt Sat Apr 20 23:39:45 2019 -0700 +++ b/service/piNode/requirements.txt Sat Apr 20 23:40:29 2019 -0700 @@ -15,5 +15,6 @@ numpy pillow imageio==2.2.0 -https://projects.bigasterisk.com/rdfdb/rdfdb-0.3.0.tar.gz +https://projects.bigasterisk.com/rdfdb/rdfdb-0.8.0.tar.gz etcd3==0.8.1 +git+http://github.com/drewp/scales.git@448d59fb491b7631877528e7695a93553bfaaa93#egg=scales