Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix memcached-tool to print about all slabs

previously hardcoded to 40. now will iterate up through all of them.
  • Loading branch information...
commit 51c6550f71b238a13f9dbc74764b8a8f3926eb3a 1 parent e04ca9b
@dormando dormando authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 scripts/memcached-tool
View
4 scripts/memcached-tool
@@ -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;
}
}
@@ -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 ?
Please sign in to comment.
Something went wrong with that request. Please try again.