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

feat: add {memory_usage} replacement #8008

Merged
merged 4 commits into from
Oct 12, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Oct 6, 2023

Description
It's useful when benchmarking in production mode.

Screenshot 2023-10-06 9 54 03

  • add {memory_usage} replacement
  • show memory usage in Welcome page

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the 4.5 label Oct 6, 2023
@kenjis kenjis marked this pull request as draft October 6, 2023 00:19
@kenjis kenjis force-pushed the add-memory-usage-in-welcome branch 2 times, most recently from c034e89 to 0294152 Compare October 6, 2023 00:43
@kenjis kenjis added the enhancement PRs that improve existing functionalities label Oct 6, 2023
@kenjis kenjis changed the title feat: show memory usage in Welcome page feat: add {memory_usage} replacement Oct 6, 2023
@kenjis kenjis marked this pull request as ready for review October 6, 2023 00:50
@kenjis kenjis force-pushed the add-memory-usage-in-welcome branch from 0294152 to 3653d74 Compare October 8, 2023 23:19
@kenjis
Copy link
Member Author

kenjis commented Oct 8, 2023

Added changelog.

*/
public function displayPerformanceMetrics(string $output): string
{
return str_replace('{elapsed_time}', (string) $this->totalTime, $output);
return str_replace(
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be an after Filter at some point on the Welcome route - no business being in the main app class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I thought the same thing.
And probably Web Page Caching also should be a filter.

@kenjis kenjis force-pushed the add-memory-usage-in-welcome branch from 3653d74 to f515488 Compare October 11, 2023 04:07
@kenjis kenjis merged commit 6d97128 into codeigniter4:4.5 Oct 12, 2023
54 checks passed
@kenjis kenjis deleted the add-memory-usage-in-welcome branch October 12, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants