summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2011-08-07 23:29:55 -0700
committerdormando <dormando@rydia.net>2011-08-10 08:44:52 -0700
commit51c6550f71b238a13f9dbc74764b8a8f3926eb3a (patch)
tree15de5028f09bf248d364aeffeee1a0f4533ecfc9 /scripts
parente04ca9b70bf1f56093143f7b825ddec078a6fd42 (diff)
downloadmemcached-51c6550f71b238a13f9dbc74764b8a8f3926eb3a.tar.gz
fix memcached-tool to print about all slabs
previously hardcoded to 40. now will iterate up through all of them.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/memcached-tool4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/memcached-tool b/scripts/memcached-tool
index ed03134..bae4efd 100755
--- a/scripts/memcached-tool
+++ b/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 ?