Tags: payprop/mojolicious-plugin-nytprof
Tags
document use of ENV variables for non-broken report links you should start your app with the env variables: PERL5OPT='-d:NYTProf' NYTPROF=start=no without this, things go a bit haywire (most obviously manifested as broken links in the report) because otherwise any code compiled before the `plugin` call cannot be covered, as described in the docs[1] bump VERSION and Changes for CPAN release [1] https://metacpan.org/pod/Devel::NYTProf#RUN-TIME-CONTROL-OF-PROFILING
some nonblocking examples/testing bump Mojolicious version requirement to 8.00, add nonblocking example to ExampleApp, document caveats with using async code with profiling note the change of the post_hook to after_dispatch in the ExampleApp, which is the reversion of 5ec7b18 (only for the example, not in the actual plugin config itself) to get the async code covered by the profiler in this example: [2019-06-28 09:05:54.12481] [71327] [debug] GET "/nonblock" (91158226) [2019-06-28 09:05:54.12496] [71327] [debug] starting NYTProf [2019-06-28 09:05:54.12589] [71327] [debug] Routing to controller "ExampleApp::ExampleController" and action "nonblock" [2019-06-28 09:05:54.12603] [71327] [info] starting request, first sleep [2019-06-28 09:05:55.13080] [71327] [info] about to wait [2019-06-28 09:05:55.13093] [71327] [info] returning from controller [2019-06-28 09:05:55.13123] [71327] [debug] Template "example_controller/nonblock.html.ep" not found [2019-06-28 09:05:55.13138] [71327] [debug] Nothing has been rendered, expecting delayed response [2019-06-28 09:05:55.13157] [71327] [info] in first callback [2019-06-28 09:05:56.13444] [71327] [info] in second callback [2019-06-28 09:05:57.13883] [71327] [debug] 200 OK (3.01398s, 0.332/s) [2019-06-28 09:05:57.13964] [71327] [debug] finished NYTProf clicking through i see all the async code in ExampleController.pm is covered. in "real world" examples the after_dispatch hook can fire out of order as per the aforementioned commit so it's "not that simple" the only other option i can think here is to tweak the way the plugin runs to add routes that allow manual switching on/off of the profiling as required and not trying to do this through the mojo hooks: /nytprof/start - start the profiler /nytprof/stop - stop the profiler not sure how well that would work, and could lead to large profiles, so i'm going to mark that as a TODO
remove URL query params from output profiles stops confusion when trying to get to the profile from the list of files under /nytprof (as the original query params would otherwise have to be URL encoded, possibly twice to keep them). it's easiest to just get rid of them instead of adding lots of escaping hackery to the code
resolve #6 - fixes for : and = on Win32 platforms escape the chars so this doesn't break due to Win32 platforms using : and = chars in different ways to Unix like platforms Squashed commit of the following: commit fc467d7 Author: Nicolas GEORGES <nicolas54.georges@gmail.com> Date: Mon Aug 3 15:16:06 2015 +0200 refs #6 - fix unit tests on mswin32 plateforms
tweak ordering of default paths for nytprofhtml cpantesters is showing failures of the form: Profile data created by incompatible perl config (NV size 16 but ours is 8) at /usr/lib/x86_64-linux-gnu/perl5/5.20/Devel/NYTProf/Data.pm line 87. if you look at the path it is actually using a different path to the perl running the tests: /home/sand/src/perl/repoperls/installed-perls/perl/v5.18.4/127e/bin/perl so calling File::Which::which is giving us the *system* perl's nytprofhtml path. switch the ordering of defaults to first use the nytprofhtml that will be in the same path as the perl running the tests/code so we don't end up getting a potentially incompatible system perl bump version to 0.12
PreviousNext