also active nodes and IPs

This commit is contained in:
Oliver Gorwits
2017-06-28 14:16:53 +01:00
parent f063110111
commit adeeaaf9bd
3 changed files with 12 additions and 0 deletions

View File

@@ -76,11 +76,17 @@ sub expire {
$schema->resultset('DevicePort')->count_rs({up => 'up'})->as_query,
ip_table_count =>
$schema->resultset('NodeIp')->count_rs->as_query,
ip_active_count =>
$schema->resultset('NodeIp')->search({-bool => 'active'},
{columns => 'ip', distinct => 1})->count_rs->as_query,
ip_count =>
$schema->resultset('NodeIp')->search(undef,
{columns => 'ip', distinct => 1})->count_rs->as_query,
node_table_count =>
$schema->resultset('Node')->count_rs->as_query,
node_active_count =>
$schema->resultset('Node')->search({-bool => 'active'},
{columns => 'mac', distinct => 1})->count_rs->as_query,
node_count =>
$schema->resultset('Node')->search(undef,
{columns => 'mac', distinct => 1})->count_rs->as_query,

View File

@@ -22,10 +22,14 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0 },
"ip_table_count",
{ data_type => "integer", is_nullable => 0 },
"ip_active_count",
{ data_type => "integer", is_nullable => 0 },
"ip_count",
{ data_type => "integer", is_nullable => 0 },
"node_table_count",
{ data_type => "integer", is_nullable => 0 },
"node_active_count",
{ data_type => "integer", is_nullable => 0 },
"node_count",
{ data_type => "integer", is_nullable => 0 },

View File

@@ -9,8 +9,10 @@ CREATE TABLE "statistics" (
"device_port_count" integer NOT NULL,
"device_port_up_count" integer NOT NULL,
"ip_table_count" integer NOT NULL,
"ip_active_count" integer NOT NULL,
"ip_count" integer NOT NULL,
"node_table_count" integer NOT NULL,
"node_active_count" integer NOT NULL,
"node_count" integer NOT NULL,
"netdisco_ver" text,