watcher.t (memcached-1.6.8) | : | watcher.t (memcached-1.6.9) | ||
---|---|---|---|---|
skipping to change at line 85 | skipping to change at line 85 | |||
# test combined logs | # test combined logs | |||
# fill to evictions, then enable watcher, set again, and look for both lines | # fill to evictions, then enable watcher, set again, and look for both lines | |||
{ | { | |||
my $value = "B"x11000; | my $value = "B"x11000; | |||
my $keycount = 8000; | my $keycount = 8000; | |||
for (1 .. $keycount) { | for (1 .. $keycount) { | |||
print $client "set n,foo$_ 0 0 11000 noreply\r\n$value\r\n"; | print $client "set n,foo$_ 0 0 11000 noreply\r\n$value\r\n"; | |||
} | } | |||
# wait for all of the writes to go through. | ||||
print $client "version\r\n"; | ||||
$res = <$client>; | ||||
$watcher = $server->new_sock; | my $mwatcher = $server->new_sock; | |||
print $watcher "watch mutations evictions\n"; | print $mwatcher "watch mutations evictions\n"; | |||
$res = <$watcher>; | $res = <$mwatcher>; | |||
is($res, "OK\r\n", "new watcher enabled"); | is($res, "OK\r\n", "new watcher enabled"); | |||
my $watcher2 = $server->new_sock; | my $watcher2 = $server->new_sock; | |||
print $watcher2 "watch evictions\n"; | print $watcher2 "watch evictions\n"; | |||
$res = <$watcher2>; | $res = <$watcher2>; | |||
is($res, "OK\r\n", "evictions watcher enabled"); | is($res, "OK\r\n", "evictions watcher enabled"); | |||
print $client "set bfoo 0 0 11000 noreply\r\n$value\r\n"; | print $client "set bfoo 0 0 11000 noreply\r\n$value\r\n"; | |||
my $found_log = 0; | my $found_log = 0; | |||
my $found_ev = 0; | my $found_ev = 0; | |||
while (my $log = <$watcher>) { | while (my $log = <$mwatcher>) { | |||
$found_log = 1 if ($log =~ m/type=item_store/); | $found_log = 1 if ($log =~ m/type=item_store/); | |||
$found_ev = 1 if ($log =~ m/type=eviction/); | $found_ev = 1 if ($log =~ m/type=eviction/); | |||
last if ($found_log && $found_ev); | last if ($found_log && $found_ev); | |||
} | } | |||
is($found_log, 1, "found rawcmd log entry"); | is($found_log, 1, "found rawcmd log entry"); | |||
is($found_ev, 1, "found eviction log entry"); | is($found_ev, 1, "found eviction log entry"); | |||
} | } | |||
# test cas command logs | # test cas command logs | |||
# TODO: need to expose active watchers in stats, so we can monitor for when | # TODO: need to expose active watchers in stats, so we can monitor for when | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 7 lines changed or added |