Skip to content

Commit

Permalink
Merge pull request #4042 from 10up/chore/issue-3987
Browse files Browse the repository at this point in the history
Improve readability of sync output
  • Loading branch information
felipeelia authored Dec 12, 2024
2 parents 39d5395 + f875dad commit 12b2b32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions includes/classes/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,11 @@ public function index_output( $message, $args, $index_meta, $context ) {
$time_elapsed = Utility::timer_stop( 2 );
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Time elapsed: ', 'elasticpress' ) . '%N' . Utility::timer_format( $time_elapsed ) . $time_elapsed_diff ) );

$current_memory = round( memory_get_usage() / 1024 / 1024, 2 ) . 'mb';
$peak_memory = ' (Peak: ' . round( memory_get_peak_usage() / 1024 / 1024, 2 ) . 'mb)';
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Memory Usage: ', 'elasticpress' ) . '%N' . $current_memory . $peak_memory ) );
$current_memory = memory_get_usage() / 1024 / 1024;
$current_memory = ( $current_memory > 1000 ) ? round( $current_memory / 1024, 2 ) . 'gb' : round( $current_memory, 2 ) . 'mb';
$peak_memory = memory_get_peak_usage() / 1024 / 1024;
$peak_memory = ( $peak_memory > 1000 ) ? round( $peak_memory / 1024, 2 ) . 'gb' : round( $peak_memory, 2 ) . 'mb';
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Memory Usage: ', 'elasticpress' ) . '%N' . $current_memory . ' (Peak: ' . $peak_memory . ')' ) );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/partials/stats-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div class="ep-flex-container">
<div class="ep-totals-column inside">
<p class="ep-totals-title"><?php esc_html_e( 'Total Documents', 'elasticpress' ); ?></p>
<p class="ep-totals-data"><?php echo esc_html( $totals['docs'] ); ?></p>
<p class="ep-totals-data"><?php echo esc_html( number_format_i18n( $totals['docs'] ) ); ?></p>
</div>
<div class="ep-totals-column inside">
<p class="ep-totals-title"><?php esc_html_e( 'Total Size', 'elasticpress' ); ?></p>
Expand Down

0 comments on commit 12b2b32

Please sign in to comment.