You are here

function coder_upgrade_memory_print in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/includes/main.inc \coder_upgrade_memory_print()

Prints memory usage to log.

Parameters

string $step: A string describing the code step when the memory usage is gathered.

7 calls to coder_upgrade_memory_print()
CoderUpgradeUnitTestCase::captureThemeInfo in coder_upgrade/coder_upgrade.test
Stores the theme registry for core modules and the modules being upgraded.
coder_upgrade.run.php in coder_upgrade/scripts/coder_upgrade.run.php
coder_upgrade_apply_parser in coder_upgrade/includes/main.inc
Applies grammar parser conversion routines to a file.
coder_upgrade_cache_info_hooks in coder_upgrade/conversions/begin.inc
Caches hook_theme() and hook_menu() entries for the modules being converted.
coder_upgrade_load_code in coder_upgrade/includes/main.inc
Loads upgrade routine code files.

... See full list

File

coder_upgrade/includes/main.inc, line 690
Manages application of conversion routines, logging, and patch file creation.

Code

function coder_upgrade_memory_print($step) {
  static $path = '';
  if (!$path) {
    $path = coder_upgrade_path('memory');

    // Clearing here works except with run.php which runs in a separate process.
    //     coder_upgrade_path_clear('memory');
  }
  coder_upgrade_path_print($path, "\n\n\n====================\n{$step}");
  coder_upgrade_path_print($path, 'Peak: ' . number_format(memory_get_peak_usage(TRUE), 0, '.', ',') . ' bytes');
  coder_upgrade_path_print($path, 'Curr: ' . number_format(memory_get_usage(TRUE), 0, '.', ',') . ' bytes');
}