Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28214

Performance info admin settings don't really work

    XMLWordPrintable

Details

    • Improvement
    • Status: Development in progress
    • Minor
    • Resolution: Unresolved
    • 2.1
    • None
    • Libraries
    • MOODLE_21_STABLE
    • MDL-28214_perfomance_settings
    • Hide

      1 : Use the "tail" command on your apache error_log file (for me : tail -f /usr/local/var/log/httpd/error_log)

      2 : Go in Administration/Development/Debugging

      3 : Check "Display performance info in footer" and apply/refresh/navigate your moodle instance : You should see performance informations in the footer and nothing in the log

      4 : Check "Log performance info" and apply/refresh/navigate your moodle instance : You should see both informations in the footer and in the log

      5 : Uncheck  "Display performance info in footer" and apply/refresh/navigate your moodle instance : You should see only performance in the logs

      Show
      1 : Use the "tail" command on your apache error_log file (for me : tail -f /usr/local/var/log/httpd/error_log) 2 : Go in Administration/Development/Debugging 3 : Check "Display performance info in footer" and apply/refresh/navigate your moodle instance : You should see performance informations in the footer and nothing in the log 4 : Check "Log performance info" and apply/refresh/navigate your moodle instance : You should see both informations in the footer and in the log 5 : Uncheck  "Display performance info in footer" and apply/refresh/navigate your moodle instance : You should see only performance in the logs

    Description

      There is some unnecessarily complicated logic in renderer_base::footer

              if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
                  $perf = get_performance_info();
                  if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {
                      error_log("PERF: " . $perf['txt']);
                  }
                  if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {
                      $performanceinfo = $perf['html'];
                  }
              }

      The logic here means that often $CFG->perfdebug is ignored, and the information is displayed anyway.

      I think this Should be changed to a set of two check-boxes:

      Track performance info: [] Display in the footer [] Write to the log file.

      The description of this setting should then have a reminder to developers that it is better to set $CFG->perfinfo in config.php, so that performance in counted right from the start of the request, rather than starting when $CFG is initialised.

      Once $CFG->perfinfo is fixed to work properly, we should then be able to eliminate all the MDL_PERF constants.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              timhunt Tim Hunt
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: