comunicationLeap/node_modules/ws/examples/serverstats/public/index.html
node_modules/ws/examples/serverstats/public/index.htmlRaw
1<!DOCTYPE html>
2<html>
3 <head>
4 <style>
5 body {
6 font-family: Tahoma, Geneva, sans-serif;
7 }
8
9 div {
10 display: inline;
11 }
12 </style>
13 <script>
14 function updateStats(memuse) {
15 document.getElementById('rss').innerHTML = memuse.rss;
16 document.getElementById('heapTotal').innerHTML = memuse.heapTotal;
17 document.getElementById('heapUsed').innerHTML = memuse.heapUsed;
18 }
19
20 var host = window.document.location.host.replace(/:.*/, '');
21 var ws = new WebSocket('ws://' + host + ':8080');
22 ws.onmessage = function (event) {
23 updateStats(JSON.parse(event.data));
24 };
25 </script>
26 </head>
27 <body>
28 <strong>Server Stats</strong><br>
29 RSS: <div id='rss'></div><br>
30 Heap total: <div id='heapTotal'></div><br>
31 Heap used: <div id='heapUsed'></div><br>
32 </body>
33</html>