Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Panel should have information about cache #2365

Closed
dilip-vishwa opened this issue Feb 8, 2014 · 8 comments
Closed

Debug Panel should have information about cache #2365

dilip-vishwa opened this issue Feb 8, 2014 · 8 comments

Comments

@dilip-vishwa
Copy link
Contributor

If the cache is used in page, then we should get some informative information about the cache component used in particular view, query, fragment, or page, etc. It should also show the content of the particular cache.

@samdark
Copy link
Member

samdark commented Feb 8, 2014

Which information would you like to have? Getting contents of the cache (keys) is not possible for many backends.

@dilip-vishwa
Copy link
Contributor Author

Following information can be shown in debug panel:-
where cache is set,
which type is used for caching data such as apc, file, db,Dummy, redis, wincache, xcache, zendcache, etc.,
Various conditions,
expiration settings and it's duration till now,
and all other possible information which can be shown.

This feature will give developer a good understanding of cache working in their web application and also works as a debugger.

@samdark
Copy link
Member

samdark commented Feb 8, 2014

  1. where cache is set = log all calls that are setting cache?
  2. which type is used for caching data such as apc, file, db,Dummy, redis, wincache, xcache, zendcache, etc. do you want this info for each call to setting cache?
  3. Various conditions = ?
  4. expiration settings and it's duration till now I'm afraid such info isn't available in many backends at all.

@dilip-vishwa
Copy link
Contributor Author

The information
Various conditions is set by developer or it's default value and
for others also same as above.

@qiangxue qiangxue added this to the 2.0 RC milestone Apr 16, 2014
@RomeroMsk
Copy link
Contributor

It will be usefull to see counters of get/set/delete/flush operations with differentiation by storages - this as minimum. As maximum - list of all opeartions in request: storage, operation (get/set/delete/flush), key, duration (for set).

@RomeroMsk
Copy link
Contributor

It will help to debug pages/requests in these cases, for example:

  1. If I see that same key is getting from cache several times in one request - it's a problem.
  2. If I see unneeded get operations (with keys wich was not used in request) - it's a problem.
  3. I thought that this data is getting from cache, but I see db query instead of cache get operation - maybe I can optimize this code.
  4. When I see unactual or corrupted data on page, I want to know what was the source: db or cache.
  5. I know that this data is storing in cache, but there are db request... Or, wait, 10 seconds duration in set!

@samdark samdark modified the milestones: 2.0 GA, 2.0 RC Apr 29, 2014
@qiangxue qiangxue modified the milestones: 2.0 GA, 2.0.1 Sep 27, 2014
@qiangxue qiangxue modified the milestones: 2.0.x, 2.0.1 Oct 20, 2014
@kidol
Copy link
Contributor

kidol commented Jun 9, 2015

Anyone in favor for the event based approach? In yii 1 one had to parse though the log to figure out cache hits/misses. With events, the debug toolbar can listen for class-level events I think:

Event::on(Cache::className(), Cache::EVENT_SET, function ($event) {
    // Collect all results for later
    // $event->sender can be used to figure out cache backend
    // $event might provide: $cacheKey, $success (whether get, set, etc. succeeded)
});

Normal logging like in yii 1 should still be added I guess?

Also a simplified version of the idea

expiration settings and it's duration till now

is possible if cache does store expire timestamp within the cache data (serialize, like with dependency). Then we could see when cache item expires. It could be an optional feature, disabled by default.

@yii-bot
Copy link

yii-bot commented Jan 24, 2016

Issue moved to yiisoft/yii2-debug#76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants