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

Profiling profilingincluded and profilingexcluded match anywhere in the url, not the full url

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_38_STABLE
    • MDL-65349-profile-match-greedy
    • Hide

      1) Mostly this is covered by unit tests now.

      2) From the GUI:

      /admin/settings.php?section=profiling

      Test the existing instructions verbatim:

      List of (comma or newline separated, absolute skipping wwwroot, callable) URLs that will be automatically profiled. Examples: /index.php, /course/view.php. Also accepts the * wildchar at any position. Examples: /mod/forum/*, /mod/*/view.php.eg 

      Eg setup a pattern of "/index.php"

      3) Now visit pages such as /my/index.php - these should NOT be profiled

      4) Make sure that /index.php IS profiled

      Show
      1) Mostly this is covered by unit tests now. 2) From the GUI: /admin/settings.php?section=profiling Test the existing instructions verbatim: List of (comma or newline separated, absolute skipping wwwroot, callable) URLs that will be automatically profiled. Examples: /index.php, /course/view.php. Also accepts the * wildchar at any position. Examples: /mod/forum /*, /mod/*/ view.php.eg  Eg setup a pattern of "/index.php" 3) Now visit pages such as /my/index.php - these should NOT be profiled 4) Make sure that /index.php IS profiled

      Each of the entries in profilingincluded and profilingexcluded is treated as a search with wildcards BUT I have always assumed that it would behave like a regex with "^search$" but it doesn't, it finds a match anywhere.

      So for instance $CFG->profilingincluded = "summ"; will match '/admin/tool/dataprivacy/summary.php'. The field comments make it sound like you should have done

      "*summ*"
      

       if you wanted this. The first example of '/index.php' will match tons of pages, including /admin/index.php and /admin/tool/profiling/index.php, so there is no way to only profile the home page.

      It isn't unit tested either.

      https://github.com/moodle/moodle/blob/master/lib/xhprof/xhprof_moodle.php#L435-L449

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Matt Porritt Matt Porritt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 55 minutes
                55m

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