Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

memcached-tool to display evicted items #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
memcached-tool does not display evicted items.
also it has a slightly odd display if the memcache is quite big (some GB)
and has long holding times.

this diff here helps in both cases.

Original issue reported on code.google.com by dl4...@gmail.com on 11 May 2009 at 10:53

GoogleCodeExporter commented 9 years ago
--- memcached-tool      2009-03-26 00:27:12.000000000 +0100
+++ /usr/bin/memcached-tool     2009-06-24 16:10:13.075183985 +0200
@@ -178,15 +178,15 @@
     }
 }

-print "  #  Item_Size   Max_age  1MB_pages Count   Full?\n";
+print "  #   Item_Size   Max_age   1MB_pages Count   Full?  evicted  
outofmem\n";
 foreach my $n (1..40) {
     my $it = $items{$n};
     next if (0 == $it->{total_pages});
     my $size = $it->{chunk_size} < 1024 ? "$it->{chunk_size} B " : 
        sprintf("%.1f kB", $it->{chunk_size} / 1024.0);
     my $full = $it->{free_chunks_end} == 0 ? "yes" : " no";
-    printf "%3d   %8s %7d s %7d %7d %7s\n",
+    printf "%3d   %9s %9d s %7d %7d %7s %7d %7d\n",
                         $n, $size, $it->{age}, $it->{total_pages},
-                        $it->{number}, $full;
+                        $it->{number}, $full, 
$it->{evicted},$it->{outofmemory};
 }

Original comment by dl4...@gmail.com on 24 Jun 2009 at 2:11

GoogleCodeExporter commented 9 years ago
Dustin checked in 7af0829ced0ff7220cd7e5fb274150087b2d6407 which covers the same
issue. Closing this one.

Original comment by dorma...@rydia.net on 7 Oct 2009 at 9:59