diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:12 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:12 +0100 |
commit | 004f4efcfd0779f4307b90fed139dc87d01ad0b9 (patch) | |
tree | f63bef356ae23f63e81e79d54c2cc911c4937004 /web/nms-public.gathering.org/api/public/dhcp-summary | |
parent | 25409cdc01450279ce56b78ce962956a9990a175 (diff) |
NMS: Various performance tweaks
Diffstat (limited to 'web/nms-public.gathering.org/api/public/dhcp-summary')
-rwxr-xr-x | web/nms-public.gathering.org/api/public/dhcp-summary | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/web/nms-public.gathering.org/api/public/dhcp-summary b/web/nms-public.gathering.org/api/public/dhcp-summary index dd643b2..a0e5609 100755 --- a/web/nms-public.gathering.org/api/public/dhcp-summary +++ b/web/nms-public.gathering.org/api/public/dhcp-summary @@ -5,16 +5,11 @@ use warnings; use nms::web; nms::web::setwhen('2h'); -my $q = $nms::web::dbh->prepare("select count(distinct mac) as clients,count(distinct ip) as addresses,count(mac) as acks from dhcp;"); -$q->execute(); -while (my $ref = $q->fetchrow_hashref()) { - $nms::web::json{'dhcp'}{'total'} = $ref; -} my $q2 = $nms::web::dbh->prepare("select count(distinct mac) as clients,count(distinct ip) as addresses,count(mac) as acks from dhcp where $nms::web::when;"); $q2->execute(); while (my $ref = $q2->fetchrow_hashref()) { - $nms::web::json{'dhcp'}{'recent'} = $ref; + $nms::web::json{'dhcp'} = $ref; } $nms::web::cc{'max-age'} = "10"; $nms::web::cc{'stale-while-revalidate'} = "15"; |