Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/META.pm |
Statements | Executed 23 statements in 532µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 136µs | 1.37s | META | Foswiki::
1 | 1 | 1 | 40µs | 54µs | BEGIN@4.42 | Foswiki::
1 | 1 | 1 | 30µs | 64µs | BEGIN@5.43 | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki; | ||||
3 | |||||
4 | 2 | 65µs | 2 | 68µs | # spent 54µs (40+14) within Foswiki::BEGIN@4.42 which was called:
# once (40µs+14µs) by Foswiki::_expandMacroOnTopicRendering at line 4 # spent 54µs making 1 call to Foswiki::BEGIN@4.42
# spent 14µs making 1 call to strict::import |
5 | 2 | 328µs | 2 | 97µs | # spent 64µs (30+34) within Foswiki::BEGIN@5.43 which was called:
# once (30µs+34µs) by Foswiki::_expandMacroOnTopicRendering at line 5 # spent 64µs making 1 call to Foswiki::BEGIN@5.43
# spent 34µs making 1 call to warnings::import |
6 | |||||
7 | # See System.VarMETA | ||||
8 | # Before calling, ensure the topicObject is loaded with the version of the | ||||
9 | # topic you intend to display! | ||||
10 | # spent 1.37s (136µs+1.37) within Foswiki::META which was called 3 times, avg 456ms/call:
# 3 times (136µs+1.37s) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm, avg 456ms/call | ||||
11 | 18 | 135µs | my ( $this, $params, $topicObject ) = @_; | ||
12 | |||||
13 | my $option = $params->{_DEFAULT} || ''; | ||||
14 | |||||
15 | # make sure the topicObject is loaded | ||||
16 | 3 | 79µs | my $loadedRev = $topicObject->getLoadedRev(); # spent 79µs making 3 calls to Foswiki::Meta::getLoadedRev, avg 26µs/call | ||
17 | $topicObject = $topicObject->load() unless defined $loadedRev; | ||||
18 | |||||
19 | if ( $option eq 'form' ) { | ||||
20 | |||||
21 | # META:FORM and META:FIELD | ||||
22 | 1 | 1.36s | return $topicObject->renderFormForDisplay(); # spent 1.36s making 1 call to Foswiki::Meta::renderFormForDisplay | ||
23 | } | ||||
24 | elsif ( $option eq 'formfield' ) { | ||||
25 | |||||
26 | # a formfield from within topic text | ||||
27 | return $topicObject->renderFormFieldForDisplay( $params->get('name'), | ||||
28 | '$value', $params ); | ||||
29 | } | ||||
30 | elsif ( $option eq 'attachments' ) { | ||||
31 | |||||
32 | # renders attachment tables | ||||
33 | 2 | 4.68ms | return $this->attach->renderMetaData( $topicObject, $params ); # spent 4.63ms making 1 call to Foswiki::attach
# spent 54µs making 1 call to Foswiki::Attach::renderMetaData | ||
34 | } | ||||
35 | elsif ( $option eq 'moved' ) { | ||||
36 | return $this->renderer->renderMoved( $topicObject, $params ); | ||||
37 | } | ||||
38 | elsif ( $option eq 'parent' ) { | ||||
39 | |||||
40 | # Only parent parameter has the format option and should do std escapes | ||||
41 | 3 | 194µs | return expandStandardEscapes( # spent 121µs making 1 call to Foswiki::Render::renderParent
# spent 64µs making 1 call to Foswiki::expandStandardEscapes
# spent 8µs making 1 call to Foswiki::renderer | ||
42 | $this->renderer->renderParent( $topicObject, $params ) ); | ||||
43 | } | ||||
44 | |||||
45 | # return nothing if invalid parameter | ||||
46 | return ''; | ||||
47 | } | ||||
48 | |||||
49 | 1 | 4µs | 1; | ||
50 | __END__ |