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

Performance info admin settings don't really work

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Development in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: Libraries
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-28214_perfomance_settings

      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

              Assignee:
              Unassigned
              Reporter:
              timhunt Tim Hunt
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: