From 289ff55c99a9bbf71130111c03baf9bb9f546e3e Mon Sep 17 00:00:00 2001 From: Len Kranendonk Date: Fri, 3 Feb 2006 22:17:24 +0000 Subject: [PATCH] Added PerlSetVar whatToProfile support --- lib/WebGUI/PerformanceProfiler.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/PerformanceProfiler.pm b/lib/WebGUI/PerformanceProfiler.pm index 2383cdb8b..9a63af306 100755 --- a/lib/WebGUI/PerformanceProfiler.pm +++ b/lib/WebGUI/PerformanceProfiler.pm @@ -46,6 +46,11 @@ PerlOutputFilterHandler WebGUI::PerformanceProfiler To the apache configuration. +By default all preloaded WebGUI code will get profiled. +You can limit the profiling to specific modules like this: + +PerlSetVar whatToProfile WebGUI::Asset::Wobject + =cut use strict; @@ -61,7 +66,6 @@ use ModPerl::Util; my @subTimes = (); my $depth = 0; my %pointer; -my $whatToProfile = 'WebGUI'; sub handler { my $r = shift; @@ -74,7 +78,10 @@ sub handler { } sub addProfilerCode { - my $r = shift; + my $r = shift; + my $s = Apache2::ServerUtil->server; + my $whatToProfile = $s->dir_config('WhatToProfile') || 'WebGUI'; + my %subs = findSubs($whatToProfile); my $myself = __PACKAGE__; while(my($name, $ref) = each(%subs)) {