diff service/arduinoNode/devices.py @ 621:686079900c20

arduinonode: per-device-type timing stats Ignore-this: de560ed6044cef5dacbf5d9b6334df99
author drewp@bigasterisk.com
date Wed, 07 Aug 2019 20:55:00 -0700
parents 3010238b94a0
children 4880a9868673
line wrap: on
line diff
--- a/service/arduinoNode/devices.py	Wed Aug 07 20:23:04 2019 -0700
+++ b/service/arduinoNode/devices.py	Wed Aug 07 20:55:00 2019 -0700
@@ -4,7 +4,8 @@
 from rdflib import Namespace, RDF, URIRef, Literal
 import time
 
-sys.path.append('../../lib')
+from greplin import scales
+
 from devices_shared import RgbPixelsAnimation
 
 ROOM = Namespace('http://projects.bigasterisk.com/room/')
@@ -41,6 +42,11 @@
 
     # subclasses may add args to this
     def __init__(self, graph, uri, pinNumber):
+        scales.init(self, self.__class__.__name__)
+        self._stats = scales.collection(self.__class__.__name__,
+                                        scales.PmfStat('poll'),
+                                        scales.PmfStat('output'),
+        )
         self.graph, self.uri = graph, uri
         self.pinNumber = pinNumber
         self.hostStateInit()