Skip to content

Commit

Permalink
fix memcached-tool to print about all slabs
Browse files Browse the repository at this point in the history
previously hardcoded to 40. now will iterate up through all of them.
  • Loading branch information
dormando committed Aug 10, 2011
1 parent e04ca9b commit 51c6550
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/memcached-tool
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ my %items; # class -> { number, age, chunk_size, chunks_per_page,
# free_chunks, free_chunks_end }

print $sock "stats items\r\n";
my $max = 0;
while (<$sock>) {
last if /^END/;
if (/^STAT items:(\d+):(\w+) (\d+)/) {
$items{$1}{$2} = $3;
$max = $1;
}
}

Expand All @@ -152,7 +154,7 @@ while (<$sock>) {
}

print " # Item_Size Max_age Pages Count Full? Evicted Evict_Time OOM\n";
foreach my $n (1..40) {
foreach my $n (1..$max) {
my $it = $items{$n};
next if (0 == $it->{total_pages});
my $size = $it->{chunk_size} < 1024 ?
Expand Down

0 comments on commit 51c6550

Please sign in to comment.