22//Requires the "speedtest-net" npm package (included in latest package.json)
33
44exports . metrics = {
5- PINGISP : { name :'PINGISP' , regexp :/ P I N G I S P \: ( [ \d \. ] + ) / i, value :'' , unit :'ms' , pin :1 , graph :1 , graphOptions : { legendLbl :'Ping ms' , lines : { lineWidth :1 } , colors : [ '#09c' ] } } ,
6- DOWNSPEED : { name :'DOWNSPEED' , regexp :/ D O W N S P E E D \: ( [ \d \. ] + ) / i, value :'' , unit :'ꜜ' , pin :1 , graph :1 , graphOptions : { legendLbl :'Mb/s' , lines : { lineWidth :1 } , colors :[ '#09c' ] } } ,
7- UPSPEED : { name :'UPSPEED' , regexp :/ U P S P E E D \: ( [ \d \. ] + ) / i, value :'' , unit :'ꜛ' , pin :1 , graph :1 , graphOptions : { legendLbl :'Mb/s' , lines : { lineWidth :1 } , colors :[ '#09c ' ] } } ,
5+ PINGISP : { name :'PINGISP' , regexp :/ P I N G I S P \: ( [ \d \. ] + ) / i, value :'' , unit :'ms' , pin :1 , graph :1 , graphOptions : { legendLbl :'Ping ms' , lines : { lineWidth :1 } , yaxis : { min : 1 , max : 200 } } } ,
6+ DOWNSPEED : { name :'DOWNSPEED' , regexp :/ D O W N S P E E D \: ( [ \d \. ] + ) / i, value :'' , unit :'ꜜ' , graphValSuffix : 'Mbps' , pin :1 , graph :1 , graphOptions : { legendLbl :'Mb/s' , lines : { lineWidth :1 } , colors :[ '#09c' ] } } ,
7+ UPSPEED : { name :'UPSPEED' , regexp :/ U P S P E E D \: ( [ \d \. ] + ) / i, value :'' , unit :'ꜛ' , graphValSuffix : 'Mbps' , pin :1 , graph :1 , graphOptions : { legendLbl :'Mb/s' , lines : { lineWidth :1 } , colors :[ '#0f0 ' ] } } ,
88}
99
1010//example of overriding a mote
@@ -26,7 +26,7 @@ exports.events = {
2626 if ( nodeRightNow )
2727 {
2828 var speedTest = require ( 'speedtest-net' ) ;
29- var test = speedTest ( { maxTime : 10000 } ) ; //10 second test
29+ var test = speedTest ( { maxTime : 5000 } ) ; //5 second test
3030
3131 test . on ( 'data' , data => {
3232 var downspeed = data . speeds . download . toFixed ( 1 ) ; //1 decimal is enough
0 commit comments