8000 [Cache] TraceableAdapter by Nyholm · Pull Request #21082 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] TraceableAdapter #21082

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

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bugfix
  • Loading branch information
Nyholm committed Dec 28, 2016
commit 7ba9b1ce632fdd110fe08d2f3dc44a25854537ea
4 changes: 3 additions & 1 deletion src/Symfony/Component/Cache/Adapter/TraceableAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function hasItem($key)
$event->end = microtime(true);
}

if (!$event->result) {
if ($event->result) {
Copy link
Member
@nicolas-grekas nicolas-grekas Dec 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking twice about this, I'd prefer removing this if/else now :) $event->result already allows to infer it, and it could be controversial to map true==hasItem to a hit. wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt the same. I'll gather this info in the DataCollector instead.

++$event->hits;
} else {
++$event->misses;
}

Expand Down
0