mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
update to stat script in contrib.
git-svn-id: file:///svn/unbound/trunk@1033 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
2904445bd2
commit
b9bf0872c2
2 changed files with 20 additions and 13 deletions
|
|
@ -28,11 +28,14 @@ my @totalstats = ();
|
||||||
# there is a special key 'thread' that indicates the thread.
|
# there is a special key 'thread' that indicates the thread.
|
||||||
my $stats = {};
|
my $stats = {};
|
||||||
my $inblock = 0;
|
my $inblock = 0;
|
||||||
my @records = ('thread', 'queries', 'answers', 'recursions', 'recursionavg',
|
my @records = ('thread', 'queries', 'cachehits', 'recursions', 'recursionavg',
|
||||||
'outstandingmax', 'outstandingavg', 'outstandingexc',
|
'outstandingmax', 'outstandingavg', 'outstandingexc',
|
||||||
'us_0', 'us_128', 'us_256', 'us_512', 'us_1024', 'us_2048', 'us_4096', 'us_8192',
|
'median25', 'median50', 'median75',
|
||||||
'us_16384', 'us_32768', 'us_65536', 'us_131072', 'us_262144', 'us_524288',
|
'us_0', 'us_1', 'us_2', 'us_4', 'us_8', 'us_16', 'us_32', 'us_64',
|
||||||
'ms_1', 'ms_2', 'ms_4', 'ms_8', 'ms_16', 'ms_32', 'ms_64', 'ms_256', 'ms_128','ms_512');
|
'us_128', 'us_256', 'us_512', 'us_1024', 'us_2048', 'us_4096',
|
||||||
|
'us_8192', 'us_16384', 'us_32768', 'us_65536', 'us_131072',
|
||||||
|
'us_262144', 'us_524288', 's_1', 's_2', 's_4', 's_8', 's_16',
|
||||||
|
's_32', 's_64', 's_128', 's_256', 's_512');
|
||||||
|
|
||||||
|
|
||||||
for my $line ( <$in> ) {
|
for my $line ( <$in> ) {
|
||||||
|
|
@ -45,28 +48,28 @@ for my $line ( <$in> ) {
|
||||||
$stats = {
|
$stats = {
|
||||||
thread => $1,
|
thread => $1,
|
||||||
queries => $2,
|
queries => $2,
|
||||||
answers => $3,
|
cachehits => $3,
|
||||||
recursions => $4,
|
recursions => $4,
|
||||||
};
|
};
|
||||||
#print STDERR "Parsing stats from thread " . $stats->{thread} . "\n";
|
#print STDERR "Parsing stats from thread " . $stats->{thread} . "\n";
|
||||||
}
|
}
|
||||||
elsif ( $inblock && $line =~ m/info: server stats for thread (\d+): requestlist max (\d+) avg ([0-9\.]+) exceeded (\d+)/ ) {
|
elsif ( $inblock && $line =~ m/info: server stats for thread (\d+): requestlist max (\d+) avg ([0-9\.]+) exceeded (\d+)/ ) {
|
||||||
$stats->{outstandingmax} = $2;
|
$stats->{outstandingmax} = $2;
|
||||||
$stats->{outstandingavg} = $3;
|
$stats->{outstandingavg} = int($3); # This is a float; rrdtool only handles ints.
|
||||||
$stats->{outstandingexc} = $4;
|
$stats->{outstandingexc} = $4;
|
||||||
}
|
}
|
||||||
if ( $inblock && $line =~ m/info: average recursion processing time ([0-9\.]+) sec/ ) {
|
if ( $inblock && $line =~ m/info: average recursion processing time ([0-9\.]+) sec/ ) {
|
||||||
$stats->{recursionavg} = $1;
|
$stats->{recursionavg} = int($1 * 1000); # change sec to milisec.
|
||||||
}
|
}
|
||||||
if ( $inblock && $line =~ m/info: histogram of recursion processing times/ ) {
|
if ( $inblock && $line =~ m/info: histogram of recursion processing times/ ) {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $inblock && $line =~ m/info: [25%]=([0-9\.]+) median[50%]=([0-9\.]+) [75%]=([0-9\.]+)/ ) {
|
if ( $inblock && $line =~ m/info: \[25%\]=([0-9\.]+) median\[50%\]=([0-9\.]+) \[75%\]=([0-9\.]+)/ ) {
|
||||||
$stats->{median25} = $1;
|
$stats->{median25} = int($1 * 1000000); # change seconds to usec
|
||||||
$stats->{median50} = $2;
|
$stats->{median50} = int($2 * 1000000);
|
||||||
$stats->{median75} = $3;
|
$stats->{median75} = int($3 * 1000000);
|
||||||
}
|
}
|
||||||
if ( $inblock && $line =~ m/info: lower(secs) upper(secs) recursions/ ) {
|
if ( $inblock && $line =~ m/info: lower\(secs\) upper\(secs\) recursions/ ) {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
elsif ( $inblock && $line =~ m/info:\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)/ ) {
|
elsif ( $inblock && $line =~ m/info:\s+(\d+)\.(\d+)\s+(\d+)\.(\d+)\s+(\d+)/ ) {
|
||||||
|
|
@ -94,7 +97,8 @@ if ( ! $stats ) {
|
||||||
|
|
||||||
my @result;
|
my @result;
|
||||||
for my $key ( @records ) {
|
for my $key ( @records ) {
|
||||||
print STDERR "$key = " . $stats->{$key} . "\n";
|
$stats->{$key} ||= 0;
|
||||||
|
print STDERR "$key = " . $stats->{$key} . "\n" if $DEBUG;
|
||||||
push @result, $stats->{$key};
|
push @result, $stats->{$key};
|
||||||
}
|
}
|
||||||
print join("\n", @result), "\n";
|
print join("\n", @result), "\n";
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
14 April 2008: Wouter
|
||||||
|
- got update for parseunbound.pl statistics script from Kai Storbeck.
|
||||||
|
|
||||||
11 April 2008: Wouter
|
11 April 2008: Wouter
|
||||||
- random port selection out of the configged ports.
|
- random port selection out of the configged ports.
|
||||||
- fixup threadsafety for libevent-1.4.3+ (event_base_get_method).
|
- fixup threadsafety for libevent-1.4.3+ (event_base_get_method).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue