diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-01 19:14:20 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-01 19:14:20 +0200 |
commit | bc83b07e4aa4c68f63f4e1b9f6f00757388ea13c (patch) | |
tree | ccb9a45430645ea80bca1b3717e453e254229a0e /web/nms.gathering.org/api/public/ping | |
parent | 1d2470a411e5eaac7e5a1c5d5b6b81e92c92f4a8 (diff) | |
parent | 3dc8afb739a03459393d3cda79bd16cefff15cae (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/api/public/ping')
-rwxr-xr-x | web/nms.gathering.org/api/public/ping | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/nms.gathering.org/api/public/ping b/web/nms.gathering.org/api/public/ping index db46b00..811708d 100755 --- a/web/nms.gathering.org/api/public/ping +++ b/web/nms.gathering.org/api/public/ping @@ -4,9 +4,9 @@ use strict; use warnings; use nms::web; -nms::web::setwhen('10s'); +nms::web::setwhen('15s'); -my $q = $nms::web::dbh->prepare("SELECT DISTINCT ON (sysname) (now() - time) as age,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE time in (select max(time) from ping where " +my $q = $nms::web::dbh->prepare("SELECT DISTINCT ON (sysname) (" . $nms::web::now . " - time) as age,sysname, latency_ms FROM ping NATURAL JOIN switches WHERE time in (select max(time) from ping where " . $nms::web::when . " group by switch)"); $q->execute(); @@ -32,6 +32,6 @@ while ( my $ref = $lq->fetchrow_hashref() ) { $nms::web::json{'linknets'}{$ref->{'linknet'}} = [ $ref->{'latency1_ms'}, $ref->{'latency2_ms'} ]; } -$nms::web::cc{'max-age'} = "2"; +$nms::web::cc{'max-age'} = "1"; $nms::web::cc{'stale-while-revalidate'} = "15"; finalize_output(); |