-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
files:scan add number of items per second on printed result table #32089
Conversation
@phil-davis can your restart drone, many thanks (Error: Client.Timeout exceeded while awaiting headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea, see comments.
apps/files/lib/Command/Scan.php
Outdated
@@ -444,11 +444,13 @@ protected function presentStats(OutputInterface $output) { | |||
*/ | |||
protected function showSummary($headers, $rows, OutputInterface $output) { | |||
$niceDate = $this->formatExecTime(); | |||
$items_per_second = $this->getItemsPerSecond(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use camel case (I hope php-cs-fixer spots this!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, just fixing it
apps/files/lib/Command/Scan.php
Outdated
} else { | ||
$items_per_second = $items / $this->execTime; | ||
} | ||
return \sprintf("%.0f", $items_per_second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest returning the float value here and format it later when adding to the table, also add a unit to the formatted text, for example "%.0f items/seconds"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the same way to return / print the time used. It returns the final string to be printed.
Adding the unit does not make sense, as the table header already says what it is: Items per second
.
You can see it in the example printouts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as yes, I missed the headers. nice
00ac0b8
to
0b8edef
Compare
From what I see adding a unit test assertion would be tricky due to the time element and not that useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Codecov Report
@@ Coverage Diff @@
## master #32089 +/- ##
============================================
+ Coverage 63.83% 63.83% +<.01%
- Complexity 18554 18556 +2
============================================
Files 1169 1169
Lines 69719 69728 +9
Branches 1264 1264
============================================
+ Hits 44504 44511 +7
- Misses 24846 24848 +2
Partials 369 369
Continue to review full report at Codecov.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
This PR adds to the table printout of files:scan the items per second processed
Related Issue
Motivation and Context
Prints a calculated performance.
Note: on low number of seconds the result may differ a bit because fractions of a second are calculated but only seconds are shown in the table
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: