performance indicators
This commit is contained in:
parent
0dd6b7b660
commit
283839a077
4 changed files with 27 additions and 9 deletions
|
|
@ -11,18 +11,23 @@ package WebGUI::Macro::AssetProxy;
|
|||
#-------------------------------------------------------------------
|
||||
|
||||
use strict;
|
||||
use Time::HiRes;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::ErrorHandler;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process {
|
||||
my ($url) = WebGUI::Macro::getParams(shift);
|
||||
my $t = [Time::HiRes::gettimeofday()] if (WebGUI::ErrorHandler::canShowPerformanceIndicators());
|
||||
my $asset = WebGUI::Asset->newByUrl($url);
|
||||
#Sorry, you cannot proxy the notfound page.
|
||||
if (defined $asset && $asset->getId ne $session{setting}{notFoundPage}) {
|
||||
$asset->toggleToolbar;
|
||||
return $asset->canView ? $asset->view : undef;
|
||||
my $output = $asset->canView ? $asset->view : undef;
|
||||
$output .= "AssetProxy:".Time::HiRes::tv_interval($t) if (WebGUI::ErrorHandler::canShowPerformanceIndicators());
|
||||
return $output;
|
||||
} else {
|
||||
return "Invalid Asset URL";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue