Commit 4be4592a authored by Gavin Brown's avatar Gavin Brown

count total queries and insert into DB

parent e4b59d19
......@@ -92,7 +92,11 @@ sub parse_json {
$data->{'start'} = strftime($datefmt, localtime($data->{'start'}));
$data->{'end'} = strftime($datefmt, localtime($data->{'end'}));
my $total = 0;
foreach my $zone (keys(%{$data->{'zones'}})) {
$total += $data->{'zones'}->{$zone}->{'queries'};
$disth->execute($data->{'host'}, $data->{'start'}, $data->{'end'}, $zone, undef, undef, undef, $data->{'zones'}->{$zone}->{'queries'});
foreach my $family (@families) {
......@@ -107,6 +111,8 @@ sub parse_json {
$disth->execute($data->{'host'}, $data->{'start'}, $data->{'end'}, $zone, undef, undef, $rcode, $data->{'zones'}->{$zone}->{'rcodes'}->{$rcode});
}
}
$disth->execute($data->{'host'}, $data->{'start'}, $data->{'end'}, undef, undef, undef, undef, $total);
}
__END__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment