-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add patch to collect eviction statistics from
Jean-Francois BUSTARRET <[email protected]>. * Updated docs, added new test cases for t/stats.t git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@476 b0b603af-a30f-0410-a34e-baf09ae79d0b
- Loading branch information
plindner
committed
Mar 20, 2007
1 parent
b89fe61
commit 4f0d730
Showing
6 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
2007-03-18 Paul Lindner <[email protected]> | ||
2007-03-20 Paul Lindner <[email protected]> | ||
* Add patch to collect eviction statistics from | ||
Jean-Francois BUSTARRET <[email protected]>. | ||
|
||
* Updated docs, added new test cases for t/stats.t | ||
|
||
2007-03-18 Paul Lindner <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,57 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use Test::More skip_all => "Tests not written."; # tests => 1 | ||
use Test::More tests => 16; | ||
use FindBin qw($Bin); | ||
use lib "$Bin/lib"; | ||
use MemcachedTest; | ||
|
||
my $server = new_memcached(); | ||
my $sock = $server->sock; | ||
|
||
|
||
## Output looks like this: | ||
## | ||
## STAT pid 16293 | ||
## STAT uptime 7 | ||
## STAT time 1174419597 | ||
## STAT version 1.2.1 | ||
## STAT pointer_size 32 | ||
## STAT rusage_user 0.012998 | ||
## STAT rusage_system 0.119981 | ||
## STAT curr_items 0 | ||
## STAT total_items 0 | ||
## STAT bytes 0 | ||
## STAT curr_connections 1 | ||
## STAT total_connections 2 | ||
## STAT connection_structures 2 | ||
## STAT cmd_get 0 | ||
## STAT cmd_set 0 | ||
## STAT get_hits 0 | ||
## STAT get_misses 0 | ||
## STAT evictions 0 | ||
## STAT bytes_read 7 | ||
## STAT bytes_written 0 | ||
## STAT limit_maxbytes 67108864 | ||
|
||
my $stats = mem_stats($sock); | ||
|
||
# Test number of keys | ||
is(scalar(keys(%$stats)), 21, "21 stats values"); | ||
|
||
# Test initial state | ||
foreach my $key (qw(curr_items total_items bytes cmd_get cmd_set get_hits evictions get_misses bytes_written)) { | ||
is($stats->{$key}, 0, "initial $key is zero"); | ||
} | ||
|
||
# Do some operations | ||
|
||
print $sock "set foo 0 0 6\r\nfooval\r\n"; | ||
is(scalar <$sock>, "STORED\r\n", "stored foo"); | ||
mem_get_is($sock, "foo", "fooval"); | ||
|
||
my $stats = mem_stats($sock); | ||
|
||
foreach my $key (qw(total_items curr_items cmd_get cmd_set get_hits)) { | ||
is($stats->{$key}, 1, "after one set/one get $key is 1"); | ||
} |