Bill,
Are you just trying to transition from your injected code into a user metric?
Then you can define a metric under the
userMetrics directory (see examples for that).
For the metric itself you can define it as you'd like, here's a quick attempt at me doing it according to your definition:
DD : { name:'DD', regexp:/\b(\d)I-\b/i, value:'', duplicateInterval:1, unit:'', pin:0, },
This would create a metric for your nI- tokens, with a value of n. Add graph=1 if you want it logged & graphed.
Then you need an event, which you can enable or disable from the node itself (BTW first you need to add it to your node (with the
+Event button from the node's details page). Here's a sample such event:
ddInfo: { label:'DogDoor info', icon:'info', descr:'Send a log message when dog door reports info tokens', serverExecute:function(node) { io.sockets.emit('LOG', 'Info-'+node.metrics['DD'].value); } },
I haven't tried it but let me know if it works.