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

Add support for exporting and importing profiling runs

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Requirements: The xhprof php extension must be installed. DB access is required.

      0) Ensure the the "profiling" table is empty.

      1) Logged in as admin, go to admin->development->profiling and enable: profilingenabled and profilingallowme.

      2) Go to admin->development->profiling runs

      3) You must see "Nothing to display" and also an "[Import] link.

      4) Follow the import link, drag the attached "test_admin.mpr" file and, as import prefix set "Imported!".

      5) You should get a "File "test_admin.mpr" imported successfully" message and get redirected back to the list of runs page, now showing 1 profiling run with url = "/admin/tool/profiling/index.php", date = current time and comment = "Imported!"

      6) Click on the date, then "View profiling details" and verify it shows, in a new tab/window, the standard xhprof report working as usual.

      7) Close the report tab/window.

      8) Try to import the same file again, you should end with error "Some problem happened importing the file "test_admin.mpr""

      9) Go to the frontpage. and add "?PROFILEME" to the URL. That will profile the frontpage.

      10) Go to admin->development->profiling runs. You should see a new run for "/index.php". Click on it and set the comment to "wow, comment", saving it. Then follow the "Export this profiling run" link.

      11) An automatic download should happen with a "md5hash.mpr" name. Rename it to "hello.zip". Unzip it. It contains 2 xml files, the "moodle_profiling_runs.xml" one and another "md5hash.xml" one.

      12) Try to import that profile run ("hello.zip"). It should fail because it already exists in the site.

      13) Empty the "profiling" table.

      14) Repeat 12) and now the profile should be imported without problem.

      15) You should see a new run for "/index.php". The default prefix "(I)" is applied to the comment "wow, comment". Click on it and follow the "View profiling details" link and verify it works as expected.

      Show
      Requirements: The xhprof php extension must be installed. DB access is required. 0) Ensure the the "profiling" table is empty. 1) Logged in as admin, go to admin->development->profiling and enable: profilingenabled and profilingallowme. 2) Go to admin->development->profiling runs 3) You must see "Nothing to display" and also an " [Import] link. 4) Follow the import link, drag the attached "test_admin.mpr" file and, as import prefix set "Imported!". 5) You should get a "File "test_admin.mpr" imported successfully" message and get redirected back to the list of runs page, now showing 1 profiling run with url = "/admin/tool/profiling/index.php", date = current time and comment = "Imported!" 6) Click on the date, then "View profiling details" and verify it shows, in a new tab/window, the standard xhprof report working as usual. 7) Close the report tab/window. 8) Try to import the same file again, you should end with error "Some problem happened importing the file "test_admin.mpr"" 9) Go to the frontpage. and add "?PROFILEME" to the URL. That will profile the frontpage. 10) Go to admin->development->profiling runs. You should see a new run for "/index.php". Click on it and set the comment to "wow, comment", saving it. Then follow the "Export this profiling run" link. 11) An automatic download should happen with a "md5hash.mpr" name. Rename it to "hello.zip". Unzip it. It contains 2 xml files, the "moodle_profiling_runs.xml" one and another "md5hash.xml" one. 12) Try to import that profile run ("hello.zip"). It should fail because it already exists in the site. 13) Empty the "profiling" table. 14) Repeat 12) and now the profile should be imported without problem. 15) You should see a new run for "/index.php". The default prefix "(I)" is applied to the comment "wow, comment". Click on it and follow the "View profiling details" link and verify it works as expected.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      It would be extremely useful to implement some simple format for exporting and importing profiling runs, enabling to share them between developers or to be stored for later comparisons.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jul/13