[patch] Perl Cache::Memcached, stats() and tests

Brad Fitzpatrick brad at danga.com
Mon Jul 2 23:42:50 UTC 2007


Ronald,

Thanks!

But one logical change per patch, please.  Things like "I also took this
opportunity to change unrelated thing $X" tend to get your patch ignored
(not just on this list, but most projects) because it's too hard to deal
with/read/etc.

See:
    http://danga.com/commit.bml

If you agree to those general rules and send me the htdigest line
described at bottom, you can commit these patches one at a time by
yourself.  Or, feel free to resend and one of us on the list can do it.

- Brad


On Tue, 19 Jun 2007, Ronald J Kimball wrote:

> After upgrading to Cache::Memcached 1.22, I still get warnings from
> calling stats() after a server has been restarted:
>
> Use of uninitialized value in addition (+) at
> /usr/share/perl5/Cache/Memcached.pm line 876.
> Use of uninitialized value in addition (+) at
> /usr/share/perl5/Cache/Memcached.pm line 885.
>
> This is because, although stats() skips the host if the socket is dead,
> it still tallies that host's stats for the total stats.
>
> Additionally, stats() tallies each host's misc stats for the total
> stats, even when misc stats were not requested (e.g.
> $memd->stats('malloc')).  This caused warnings and put spurious 0 values
> in the stats totals.
>
>
> The attached patch fixes these issues, by moving the calculation of
> total stats into the processing loop.
>
>
> I also took this opportunity to update the tests for Cache::Memcached:
> I renamed use.t to 01_use.t.
> I renamed all.t to 02_keys.t and added tests for delete().
> I created 03_stats.t to test the results of stats().
> The numbers ensure that the test files are run in the appropriate order.
>
>
> Ronald
>
>


More information about the memcached mailing list