diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-14 04:12:50 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2015-04-14 04:12:50 +0200 |
commit | e082f5ddb4735ec783a499b6b0066c3459e14618 (patch) | |
tree | e7ee188bddec8d3a24a309062387103f8ed6ebb8 /web/nms.gathering.org/nms2/index.html | |
parent | ccb0325bb1691faaf009523f5513db009c640a61 (diff) |
NMS: Performance tuning on multiple layers
1. Add scaffolding for frontend timer tweaks, and a simple debug UI for it.
2. Add frontend ajax-tracker, to avoid spamming the backend too fast when
it's unable to cope.
3. Considerably simplify the SQL
The SQL tuning has drastically cut the response time of port-state.pl. I
need to update the schema too to reflect the new indexes I'm using.
Diffstat (limited to 'web/nms.gathering.org/nms2/index.html')
-rw-r--r-- | web/nms.gathering.org/nms2/index.html | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/web/nms.gathering.org/nms2/index.html b/web/nms.gathering.org/nms2/index.html index ffa36a3..211bcf9 100644 --- a/web/nms.gathering.org/nms2/index.html +++ b/web/nms.gathering.org/nms2/index.html @@ -70,6 +70,7 @@ <li><a href="#">Scale: <div id="scaler-text"></div></a></li> <li class="divider"> </li> <li><a onclick="document.getElementById('aboutBox').style.display = 'block'; hideSwitch();" style="cursor: pointer;" >About</a></li> + <li><a onclick="showTimerDebug(); hideSwitch();" style="cursor: pointer;" >Debug timers</a></li> </ul> </li> <li><p id="updater_name" class="navbar-text"></p></li> @@ -199,6 +200,19 @@ </div> </div> + <div id="debugTimers" class="panel panel-default" style="display: none; position: fixed; z-index: 100;"> + <div class="panel-heading"><h1 class="panel-title">Debug + timers (e.g.: Break stuff! FAST!) + <button type="button" class="close" aria-labe="Close" onclick="document.getElementById('debugTimers').style.display = 'none';" style="float: right;"><span aria-hidden="true">×</span></button></h3></div> + <div id="timerTableTop" class="panel-body"> + <p>These are internal timers for the NMS frontend. They are + provided mainly to debug the frontend. Setting AJAX-triggering + counters to ridiculous numbers is not advised (mainly because + it causes server load).</p> + <table id="timerTable"> </table> + </div> + </div> + <canvas id="bgCanvas" width="1920" height="1032" style="position: fixed; z-index: 1;"> </canvas> <canvas id="linkCanvas" width="1920" height="1032" style="position: fixed; z-index: 10;"> </canvas> <canvas id="blurCanvas" width="1920" height="1032" style="position: fixed; z-index: 20;"> </canvas> @@ -215,35 +229,7 @@ <script src="js/bootstrap.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/nms.js"></script> <script type="text/javascript"> - updatePorts(); - updatePing(); - window.addEventListener('resize',resizeEvent,true); - document.addEventListener('load',resizeEvent,true); - setInterval(updatePorts,1000); - setInterval(updateInfo,5000); - setInterval(updatePing,1000); - setInterval(updateMap,1000); - setInterval(updateSpeed,3000); - url = document.URL; - if (/#ping/.exec(url)) { - setUpdater(handler_ping); - }else if (/#uplink/.exec(url)) { - setUpdater(handler_uplinks); - } else if (/#temp/.exec(url)) { - setUpdater(handler_temp); - } else if (/#traffic/.exec(url)) { - setUpdater(handler_traffic); - } else if (/#disco/.exec(url)) { - setUpdater(handler_disco); - } else { - setUpdater(handler_ping); - } - if (/nightMode/.exec(url)) { - toggleNightMode(); - } - $(function () { - $('[data-toggle="tooltip"]').tooltip() - }) + initNMS(); </script> </body> </html> |