summaryrefslogtreecommitdiff
path: root/node_modules/ws/examples/serverstats-express_3/public/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ws/examples/serverstats-express_3/public/index.html')
-rw-r--r--node_modules/ws/examples/serverstats-express_3/public/index.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/node_modules/ws/examples/serverstats-express_3/public/index.html b/node_modules/ws/examples/serverstats-express_3/public/index.html
new file mode 100644
index 0000000..24d84e1
--- /dev/null
+++ b/node_modules/ws/examples/serverstats-express_3/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>