I've often needed to pull a value from Memcached for troubleshooting. Since PHP serializes the array, it's hard to read the value through basic Memcached commands. This Drush command makes that much easier.

Comments

erikwebb’s picture

Status: Active » Needs review
StatusFileSize
new1.57 KB
markpavlitski’s picture

Status: Needs review » Needs work

This looks like a very useful feature.

Is there any reason to call dmemcache_get() twice rather than just using the $item variable?

Since drush requires the corresponding module to be enabled, would it be better to attach this to memcache_admin module instead?

erikwebb’s picture

Category: task » feature
Status: Needs work » Needs review
StatusFileSize
new1.55 KB
erikwebb’s picture

I'm not sure we should attach this to memcache_admin, because personally I never use that module. Maybe there's some way we can get around this?

Let's finish the review of the code itself and then we can figure out the placement before committing anything.

erikwebb’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

I suppose this could probably be built generically for caches in general and suggested for Drush core.

linvald’s picture

Status: Closed (won't fix) » Needs review
StatusFileSize
new4.7 KB

Hi

Reopening this ticket because i think these commands, stats and flush_all probably wont be available in a future generic drush cache implementation as these commands are Memcached specific.

The patch is different from the previous patches in that it doesn't implement cache get/set (as these are already available in https://github.com/drush-ops/drush/blob/6.x/commands/core/cache.drush.inc and https://github.com/drush-ops/drush/blob/7.x/commands/core/cache.drush.inc )

  • Jeremy committed b45d496 on 7.x-1.x
    Issue #1993170 by erikwebb, linvald, Jeremy: add Drush commands to flush...
jeremy’s picture

Status: Needs review » Fixed

Reworked the code and committed. Also added documentation to README:

## DRUSH ##
  
Enable the memcache module at admin/modules or with 'drush en memcache', then
rebuild the drush cache by running 'drush cc drush'. This will enable the
following drush commands:

  memcache-clear (mcc)  Flush all Memcached objects in a bin.
  memcache-stats (mcs)  Retrieve statistics from Memcached.

For more information about each command, use 'drush help'. For example:
  drush help mcc

Or:
  drush help mcs

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

grahamvalue’s picture

memcache-clear (mcc)  Flush all Memcached objects in a bin.
memcache-stats (mcs)  Retrieve statistics from Memcached.

Is there an estimate of when these commands will become available?

Thanks for the great work!

jeremy’s picture

You can try it in https://www.drupal.org/project/memcache/releases/7.x-1.6-rc2 -- it will be included with the 7.x-1.6 release.

grahamvalue’s picture

Thank you!