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

Allow profiling comparisons with more than one previous run

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.2
    • Component/s: Performance
    • Labels:
    • Testing Instructions:
      Hide

      PREREQUSITES:

      1. You need the xhprof extension installed.

      Login as Admin

      Administration > Site Administration > Development > Profiling

      • Enable Profiling
      • Profile these should be * for all.
      • Save changes

      Administration > Site Administration > Development > Profiling Runs

      • Refresh to Profiling Runs page 5 times.
      • Select to top 3 profiling runs, for each of them
        1. Click the date
        2. Fill in "Mark as reference run/command" with a tick.
        3. Fill in a comment in two of them, but leave the third blank

      Return to; Administration > Site Administration > Development > Profiling Runs

      Click on the profiling script name under URL (admin/tool/profiling/index.php).
      Confirm 3 reference runs are displayed correctly.

      Go back to the profiling list page (Back button).
      Click on the "Date" next to the top profile run for admin/tool/profiling/index.php
      Confirm 3 reference runs are displayed correctly.

      Go back to the profiling list page (Back button).
      Click on the "Date" next to the second bottom profile run for admin/tool/profiling/index.php
      Confirm no reference runs are displayed correctly.

      Open all the reference runs and uncheck them as references.

      Go back to the profiling list page
      Click on the profiling script name under URL (admin/tool/profiling/index.php).
      Confirm no reference runs are displayed.

      Show
      PREREQUSITES: You need the xhprof extension installed. Login as Admin Administration > Site Administration > Development > Profiling Enable Profiling Profile these should be * for all. Save changes Administration > Site Administration > Development > Profiling Runs Refresh to Profiling Runs page 5 times. Select to top 3 profiling runs, for each of them Click the date Fill in "Mark as reference run/command" with a tick. Fill in a comment in two of them, but leave the third blank Return to; Administration > Site Administration > Development > Profiling Runs Click on the profiling script name under URL (admin/tool/profiling/index.php). Confirm 3 reference runs are displayed correctly. Go back to the profiling list page (Back button). Click on the "Date" next to the top profile run for admin/tool/profiling/index.php Confirm 3 reference runs are displayed correctly. Go back to the profiling list page (Back button). Click on the "Date" next to the second bottom profile run for admin/tool/profiling/index.php Confirm no reference runs are displayed correctly. Open all the reference runs and uncheck them as references. Go back to the profiling list page Click on the profiling script name under URL (admin/tool/profiling/index.php). Confirm no reference runs are displayed.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-40793_profile_compare

      Description

      Currently you can only compare a profile with the previous reference run for a single script. This is not always what you need. For example, restore.php has 7 steps that all get profiled under the same script name. It is normal to have baseline profiles for at least 2 of those pages. As a result, you need to be able to quickly pick the relevant reference profile to compare against.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            mr-russ Russell Smith added a comment -

            Implementing this will assist with performance testing around restore in MDL-40579 and linked issues.

            Show
            mr-russ Russell Smith added a comment - Implementing this will assist with performance testing around restore in MDL-40579 and linked issues.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Nice one!

            I just would comment about to add the phpdocs to profiling_print_run(). I know there are not many functions documented there, but any moment is good to start and, as far as it's being modified...

            Also, I'd suggest to backport this to 2.5. This change does not affect anything but the profiling tool, sure it applies clean and can be a nice commodity there.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Nice one! I just would comment about to add the phpdocs to profiling_print_run(). I know there are not many functions documented there, but any moment is good to start and, as far as it's being modified... Also, I'd suggest to backport this to 2.5. This change does not affect anything but the profiling tool, sure it applies clean and can be a nice commodity there. Ciao
            Hide
            mr-russ Russell Smith added a comment -

            Both those requests have been actioned. I have added the comments and backported to 2.5.

            Show
            mr-russ Russell Smith added a comment - Both those requests have been actioned. I have added the comments and backported to 2.5.
            Hide
            poltawski Dan Poltawski added a comment -

            Thanks Russell! I've integrated this to master and 25.

            If this file was in a more modern moodley style (which it's not), it'd be nice to see some of those urls and links as moodle_url's and html_writer. (Mostly saying this in case you were not aware of those classes.)

            cheers!

            Show
            poltawski Dan Poltawski added a comment - Thanks Russell! I've integrated this to master and 25. If this file was in a more modern moodley style (which it's not), it'd be nice to see some of those urls and links as moodle_url's and html_writer. (Mostly saying this in case you were not aware of those classes.) cheers!
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            yeah, it need overall modernization. it's early 2.0dev, old style, stronk7 code. +1

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - yeah, it need overall modernization. it's early 2.0dev, old style, stronk7 code. +1
            Hide
            phalacee Jason Fowler added a comment -

            works perfectly Eloy, thanks.

            Show
            phalacee Jason Fowler added a comment - works perfectly Eloy, thanks.
            Hide
            damyon Damyon Wiese added a comment -

            Thanks again for another week of fixes, improvements and testing. These changes have been released to the world.

            Cheers, Damyon

            Show
            damyon Damyon Wiese added a comment - Thanks again for another week of fixes, improvements and testing. These changes have been released to the world. Cheers, Damyon
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Hi,
            While working on some profiling for events, I noticed the following errors when trying to view a run details:-

            Warning: Cannot use a scalar value as an array in /var/www/stable/pgmaster/lib/outputrenderers.php on line 2694 Call Stack: 0.0003 278824 1. {main}() /var/www/stable/pgmaster/admin/tool/profiling/index.php:0 0.7855 51182800 2. profiling_print_run() /var/www/stable/pgmaster/admin/tool/profiling/index.php:132 0.7872 51196512 3. core_renderer->box() /var/www/stable/pgmaster/lib/xhprof/xhprof_moodle.php:303 0.7872 51196512 4. core_renderer->box_start() /var/www/stable/pgmaster/lib/outputrenderers.php:2681 Warning: Cannot use a scalar value as an array in /var/www/stable/pgmaster/lib/outputrenderers.php on line 2695 Call Stack: 0.0003 278824 1. {main}() /var/www/stable/pgmaster/admin/tool/profiling/index.php:0 0.7855 51182800 2. profiling_print_run() /var/www/stable/pgmaster/admin/tool/profiling/index.php:132 0.7872 51196512 3. core_renderer->box() /var/www/stable/pgmaster/lib/xhprof/xhprof_moodle.php:303 0.7872 51196512 4. core_renderer->box_start() /var/www/stable/pgmaster/lib/outputrenderers.php:2681
             
            Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
             
            Debug info: Argument 2 passed to html_writer::start_tag() must be of the type array, boolean given, called in [dirroot]/lib/outputrenderers.php on line 2696 and defined
            Error code: codingerror
            Stack trace:
             
                line 406 of /lib/setuplib.php: coding_exception thrown
                line 1027 of /lib/outputcomponents.php: call to default_error_handler()
                line 2696 of /lib/outputrenderers.php: call to html_writer::start_tag()
                line 2681 of /lib/outputrenderers.php: call to core_renderer->box_start()
                line 303 of /lib/xhprof/xhprof_moodle.php: call to core_renderer->box()
                line 132 of /admin/tool/profiling/index.php: call to profiling_print_run() 

            The error is gone if I revert my git HEAD to 2e746b72beedd340550e4f176f5aa1cd55305e72

            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Hi, While working on some profiling for events, I noticed the following errors when trying to view a run details:- Warning: Cannot use a scalar value as an array in /var/www/stable/pgmaster/lib/outputrenderers.php on line 2694 Call Stack: 0.0003 278824 1. {main}() /var/www/stable/pgmaster/admin/tool/profiling/index.php:0 0.7855 51182800 2. profiling_print_run() /var/www/stable/pgmaster/admin/tool/profiling/index.php:132 0.7872 51196512 3. core_renderer->box() /var/www/stable/pgmaster/lib/xhprof/xhprof_moodle.php:303 0.7872 51196512 4. core_renderer->box_start() /var/www/stable/pgmaster/lib/outputrenderers.php:2681 Warning: Cannot use a scalar value as an array in /var/www/stable/pgmaster/lib/outputrenderers.php on line 2695 Call Stack: 0.0003 278824 1. {main}() /var/www/stable/pgmaster/admin/tool/profiling/index.php:0 0.7855 51182800 2. profiling_print_run() /var/www/stable/pgmaster/admin/tool/profiling/index.php:132 0.7872 51196512 3. core_renderer->box() /var/www/stable/pgmaster/lib/xhprof/xhprof_moodle.php:303 0.7872 51196512 4. core_renderer->box_start() /var/www/stable/pgmaster/lib/outputrenderers.php:2681   Coding error detected, it must be fixed by a programmer: PHP catchable fatal error   Debug info: Argument 2 passed to html_writer::start_tag() must be of the type array, boolean given, called in [dirroot]/lib/outputrenderers.php on line 2696 and defined Error code: codingerror Stack trace:   line 406 of /lib/setuplib.php: coding_exception thrown line 1027 of /lib/outputcomponents.php: call to default_error_handler() line 2696 of /lib/outputrenderers.php: call to html_writer::start_tag() line 2681 of /lib/outputrenderers.php: call to core_renderer->box_start() line 303 of /lib/xhprof/xhprof_moodle.php: call to core_renderer->box() line 132 of /admin/tool/profiling/index.php: call to profiling_print_run() The error is gone if I revert my git HEAD to 2e746b72beedd340550e4f176f5aa1cd55305e72 Thanks
            Hide
            mr-russ Russell Smith added a comment -

            Ankit, what theme are you running. I must have been testing on a theme without output renderers. Feel free to open a new issue and I will follow up.

            Show
            mr-russ Russell Smith added a comment - Ankit, what theme are you running. I must have been testing on a theme without output renderers. Feel free to open a new issue and I will follow up.

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Sep/13