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

[DoctrineBridge] Global query time always at 0.00 ms on profiler#52881

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

Merged
derrabus merged 1 commit intosymfony:6.4frommaximethiry:fix_52880
Dec 22, 2023
Merged

[DoctrineBridge] Global query time always at 0.00 ms on profiler#52881

derrabus merged 1 commit intosymfony:6.4frommaximethiry:fix_52880
Dec 22, 2023

Conversation

@maximethiry
Copy link

@maximethirymaximethiry commentedDec 4, 2023
edited
Loading

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
IssuesFix#52880
LicenseMIT

(original explanation made from 7.0 branch, now targeting 6.4 cf comments)

The related issue, when i explained the possible solution :#52880

OnSymfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector, updated the native return type fromint tofloat for the methodgetTime.

Context :

    public function getTime(): int    {        $time = 0;        foreach ($this->data['queries'] as $queries) {            foreach ($queries as $query) {                $time += $query['executionMS'];            }        }        return $time;    }

Inside this method, the value of$time was always a float smaller than 0. The transition to native return type (which was correct regarding to old phpdoc type) made the return cast int to the floating value, hence returning always 0.

I updated the return type to float and updated the test to check for the calculus on floating values.
I had to switch to usleep instead of sleep, since the value might not be an int.

maelanleborgne and andreybolonin reacted with thumbs up emoji
@carsonbot

This comment was marked as resolved.

@carsonbotcarsonbot changed the title[Bug][DoctrineBridge] Global query time always at 0.00 ms on profiler[DoctrineBridge] Global query time always at 0.00 ms on profilerDec 4, 2023
@nicolas-grekas
Copy link
Member

Can you please rebase the PR on 6.4 to change the annotation there instead?
We will handle the case for 7.0 while merging that PR on 6.4 into 7.0.

derrabus reacted with thumbs up emoji

@maximethiry
Copy link
Author

Thanks for the feedback, will do the rebase 👍
Should I keep the test for floats values, after moving it in a more appropriate function as requested by@derrabus ?

@derrabus
Copy link
Member

Yes, please keep the test!

maximethiry reacted with thumbs up emoji

@maximethirymaximethiry changed the base branch from7.0 to6.4December 6, 2023 21:03
@derrabusderrabus modified the milestones:7.0,6.4Dec 22, 2023
@derrabus
Copy link
Member

Thank you@maximethiry.

maximethiry reacted with heart emoji

@derrabusderrabus merged commitcf85540 intosymfony:6.4Dec 22, 2023
@derrabus
Copy link
Member

We will handle the case for 7.0 while merging that PR on 6.4 into 7.0.

Done.

xabbuh added a commit that referenced this pull requestDec 22, 2023
This PR was merged into the 6.4 branch.Discussion----------Fix expected return type file| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        | -| License       | MITAfter#52881Commits-------ad8096b Fix expected return type
This was referencedDec 30, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

4 participants

@maximethiry@carsonbot@nicolas-grekas@derrabus

[8]ページ先頭

©2009-2025 Movatter.jp