[#131] More correct network space utilization (M. Kosmach)

This commit is contained in:
Oliver Gorwits
2014-08-08 23:08:58 +01:00
parent d943b5d125
commit 1e58a045d4
2 changed files with 2 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
SELECT net as subnet,
power(2, (32 - masklen(net))) as subnet_size,
count(DISTINCT ip) as active,
round(100 * count(DISTINCT ip) / power(2, (32 - masklen(net)))) as percent
round(100 * count(DISTINCT ip) / (power(2, (32 - masklen(net))) - 2)) as percent
FROM (
SELECT DISTINCT net, ni.ip
FROM subnets s1, node_ip ni