first commit
This commit is contained in:
33
node_modules/streamws/examples/serverstats/public/index.html
generated
vendored
Normal file
33
node_modules/streamws/examples/serverstats/public/index.html
generated
vendored
Normal file
@ -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>
|
Reference in New Issue
Block a user