[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] Logging slow pages


On 06/14/2006 04:51 AM, Mark Johnson wrote:
Use IC's [time] instead:
[calcn]
	$Tag->tmpn('StartTime', $Tag->time({},'%s'));
	return;
[/calcn]

Then you access it via $Scratch->{StartTime}:

[calcn]
     my $long_page_time = $Variable->{LONG_PAGE_TIME} || 5;
     my $page_time = $Tag->time({},'%s') - $Scratch->{StartTime};
     if ($page_time >= $long_page_time) {
          my $mv_page = $Tag->var('MV_PAGE',1);
          my $remote_addr = $Session->{shost} || $Session->{ohost};
          Debug(qq{Slow page: $Variable->{IC_CATALOG}/$mv_page, Time:
$page_time, remote_host: $remote_addr, CGI:} .
 ::uneval($CGI));
     }
     return;
[/calcn]

You shouldn't need $Tag->tmpn. Just set a global (initialise without my), it will hold till the end of the page...

[calcn]
	$start_time = $tag->time({},'%s');
	return;
[/calcn]

...

[calcn]
	my $long_page_time = $Variable->{LONG_PAGE_TIME} || 5;
	my $page_time = $tag->time({},'%s') - $start_time;

	...

[/calcn]

Peter
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.