diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-03-20 17:33:43 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-03-20 17:33:43 -0700 |
| commit | 2afbcf4e7d000d99fdbc582d7113684ee00e80cc (patch) | |
| tree | 6ba3313b78625735fb295e3d375e59054c31e558 /node_modules/ws/examples/serverstats/public/index.html | |
first
Diffstat (limited to 'node_modules/ws/examples/serverstats/public/index.html')
| -rw-r--r-- | node_modules/ws/examples/serverstats/public/index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/node_modules/ws/examples/serverstats/public/index.html b/node_modules/ws/examples/serverstats/public/index.html new file mode 100644 index 0000000..24d84e1 --- /dev/null +++ b/node_modules/ws/examples/serverstats/public/index.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <style> + body { + font-family: Tahoma, Geneva, sans-serif; + } + + div { + display: inline; + } + </style> + <script> + function updateStats(memuse) { + document.getElementById('rss').innerHTML = memuse.rss; + document.getElementById('heapTotal').innerHTML = memuse.heapTotal; + document.getElementById('heapUsed').innerHTML = memuse.heapUsed; + } + + var host = window.document.location.host.replace(/:.*/, ''); + var ws = new WebSocket('ws://' + host + ':8080'); + ws.onmessage = function (event) { + updateStats(JSON.parse(event.data)); + }; + </script> + </head> + <body> + <strong>Server Stats</strong><br> + RSS: <div id='rss'></div><br> + Heap total: <div id='heapTotal'></div><br> + Heap used: <div id='heapUsed'></div><br> + </body> +</html> |
