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

Performance info admin settings don't really work

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.1
    • 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

      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.

            Unassigned Unassigned
            timhunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.