ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Caching statistics

Open TheLastCicada opened this issue 8 years ago • 2 comments

I'd love to have a way to get some cache statistics out of wp-cli. Things I'm thinking of would be like

  • page cache hit rate
  • cache avg response time
  • cache eviction rate
  • % of cache used
  • % of cached items access over x number of minutes (I don't know any tool that does this currently....would be great data for sizing a memcached server. Could have this run for 10 minutes at the command line and collect data, then offer a report at the end. Will be tricky)
  • number of database queries saved by using caching

With the various object cache and advanced cache files out there this might be difficult to implement universally. Maybe it could be done for the most common caching plugins, or maybe we could build a framework that caching plugins can tie into with some simple integration code. Or this might be nearly impossible, but it'd be cool if we could do it.

TheLastCicada avatar Jan 15 '17 19:01 TheLastCicada

I'd love to have a way to get some cache statistics out of wp-cli.

To clarify, would this be cache statistics from web PHP processes? If so, how would WP-CLI get access to that data?

See also https://github.com/wp-cli/profile-command, specifically:

  • https://github.com/wp-cli/profile-command/issues/128
  • https://github.com/wp-cli/profile-command/issues/16
  • https://github.com/wp-cli/profile-command/issues/10

danielbachhuber avatar Jan 16 '17 14:01 danielbachhuber

Mostly I'm thinking of the use case of memcached, but it could be applicable to other cache backends too. Some of these stats can be pulled directly from Memcached and some would need to be monitored over time. Not thinking of it specifically for web PHP processes, but more from an overall cache health perspective. https://github.com/wp-cli/profile-command/issues/128 is a great idea and along the lines of what I was thinking.

TheLastCicada avatar Jan 16 '17 18:01 TheLastCicada