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

Cache should log all actions to Tracy #58

Open
janbarasek opened this issue Feb 4, 2020 · 3 comments
Open

Cache should log all actions to Tracy #58

janbarasek opened this issue Feb 4, 2020 · 3 comments

Comments

@janbarasek
Copy link

Sometimes I need debug application performance and I want detect how many time and how many requests cache must do.

Imagine something like this panel:

Snímek obrazovky 2020-02-04 v 14 16 44

I think logging process should be implemented in Storage like low-level operation and specific Storage should implement logging proces.

In specific Storage can be array like this:

private $log = [
   [ // sample record. By default will be empty array
      'action' => 'read',
      'key' => 'article-list',
      'params' => [],
      'time' => 24.7
   ]
];

public function getLog(): array {
   return $this->log;
}

In Tracy I can read current IStorage and get list of actions by optional public getter.

I can implement it for native package storages.

What do you think? Thanks.

@mabar
Copy link

mabar commented Feb 4, 2020

I can implement it for native package storages.

Couldn't it use adapter pattern?

@janbarasek
Copy link
Author

@mabar I think it can be solved by trait or SmartObject events.

@dg
Copy link
Member

dg commented Mar 31, 2020

this is related 6a7b96d

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

No branches or pull requests

3 participants