You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
875 B

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