Permalink
Browse files

Complete implementation

  • Loading branch information...
wdavidw committed Jan 11, 2012
1 parent b58e5bf commit d8f1c27412c48e587ad8aa558581161a3fd464b5
View
@@ -0,0 +1,24 @@
+
+Node Sigar binding
+==================
+
+Documentation is available on the [project website](http://www.adaltas.com/projects/node-sigar.html).
+
+Problems
+--------
+
+- Calling `sigar_net_address_to_string` throw symbol error
+ Impacted functions: `netRouteListGet`, `netInterfaceConfigGet`, `netInterfaceConfigPrimaryGet`, `netConnectionListGet`
+ Solution: import related source code in './src/node_sigar_format.cc'
+- `netconnectionlist()` doesn't handle flag, use '-1' for now
+- String to address function isn't working in `node_sigar_str2net_address`.
+ Impacted function: `SigarNetStatPortGet`
+ See: `./tests/TodoTest.coffee # Test testNetAdress`
+- Protocal in `sigar_proc_port_get` seems disregarded
+- No idea on how to use `rpcPing`, see `./tests/TodoTest.coffee # Test rpcPing`
+
+Notes
+-----
+
+- `sigar_net_connection_walk` is not implemented
+- `sigar_who_list_get` return 0 records on OSX
View
@@ -0,0 +1,68 @@
+
+sigar = require '..'
+
+l = 1*1000*1000
+
+###
+i = 0
+time = (new Date).getTime()
+while i++ < l
+ sigar()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+###
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.swap()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.cpu()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.cpuList()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.cpuInfoList()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.loadavg()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.resourceLimit()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.procList()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
+
+i = 0
+s = sigar()
+time = (new Date).getTime()
+while i++ < l
+ s.procStat()
+console.log Math.round(l / (Date.now() - time) * 1000), ' per seconds'
Oops, something went wrong.

0 comments on commit d8f1c27

Please sign in to comment.