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/ping-json2.pl | |
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/ping-json2.pl')
-rwxr-xr-x | web/nms.gathering.org/ping-json2.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/web/nms.gathering.org/ping-json2.pl b/web/nms.gathering.org/ping-json2.pl index a24c589..e2b29ae 100755 --- a/web/nms.gathering.org/ping-json2.pl +++ b/web/nms.gathering.org/ping-json2.pl @@ -16,7 +16,7 @@ my $when =" updated > " . $now . " - '15 secs'::interval and updated < " . $now my %json = (); -my $q = $dbh->prepare("SELECT DISTINCT ON (switch,sysname) switch,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE $when ORDER BY switch,sysname, updated DESC;"); +my $q = $dbh->prepare("SELECT DISTINCT updated,switch,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE $when ORDER BY updated DESC;"); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { $json{'switches'}{$ref->{'sysname'}}{'latency'} = $ref->{'latency_ms'}; |