From 51c6550f71b238a13f9dbc74764b8a8f3926eb3a Mon Sep 17 00:00:00 2001 From: dormando Date: Sun, 7 Aug 2011 23:29:55 -0700 Subject: fix memcached-tool to print about all slabs previously hardcoded to 40. now will iterate up through all of them. --- scripts/memcached-tool | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ? -- cgit v1.2.1