Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@Nyholm
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsRelated to#21065
LicenseMIT
Doc PRn/a

I moved the TraceableAdapter to a separate PR and added some tests. I found a small bug which was fixed.

public static function setupBeforeClass()
{
parent::setupBeforeClass();
self::$redis = new \Redis();

Choose a reason for hiding this comment

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

I'd base this on FilesystemAdapter so that more people can run the tests

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks... I just want an adapter that can run all tests.

@nicolas-grekas
Copy link
Member

👍

$event->end = microtime(true);
}

if ($event->result) {
Copy link
Member

@nicolas-grekasnicolas-grekasDec 28, 2016
edited
Loading

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
MemberAuthor

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.

}

/**
* @internal
Copy link
Member

Choose a reason for hiding this comment

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

Does it really make sense to tag the event class as internal when we return it in thegetCalls() method?

Choose a reason for hiding this comment

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

OK for removing the tag then

Copy link
Member

Choose a reason for hiding this comment

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

👍 after this change

@xabbuh
Copy link
Member

👍

Status: Reviewed


public function getCalls()
{
return $this->calls;
Copy link
Member

@nicolas-grekasnicolas-grekasDec 29, 2016
edited
Loading

Choose a reason for hiding this comment

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

What about resetting$this->calls here? This would allow reusing the same adapter several times in a long running process with no mem leak.

$calls =$this->calls;$this->calls =array();return$calls;

or

try {return$this->calls;}finally {$this->calls =array();}

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure, makes sense

* @author Tobias Nyholm <tobias.nyholm@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*/
class TraceableAdapter implements AdapterInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

Isnt it more a wrapper then a adapter as the class doesnt adapt one api for another?

prisis reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Strictly seen you are right. But I think it would be weird to change the name as we are implementing theAdapterInterface here, wouldn't it?

nicolas-grekas and staabm reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

I see

@nicolas-grekas
Copy link
Member

Thank you@Nyholm.

nicolas-grekas added a commit that referenced this pull requestDec 29, 2016
This PR was squashed before being merged into the 3.3-dev branch (closes#21082).Discussion----------[Cache] TraceableAdapter| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | Related to#21065| License       | MIT| Doc PR        | n/aI moved the TraceableAdapter to a separate PR and added some tests. I found a small bug which was fixed.Commits-------5cc4baf [Cache] TraceableAdapter
@Nyholm
Copy link
MemberAuthor

Thank you for merging

@NyholmNyholm deleted the cache-traceable-adapter branchDecember 29, 2016 12:07
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@xabbuhxabbuhxabbuh left review comments

+1 more reviewer

@staabmstaabmstaabm left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@Nyholm@nicolas-grekas@xabbuh@staabm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp