File: Status.pod

package info (click to toggle)
libapache2-mod-perl2 2.0.13-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 12,016 kB
  • sloc: perl: 97,771; ansic: 14,493; makefile: 51; sh: 18
file content (236 lines) | stat: -rw-r--r-- 5,644 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
=head1 NAME

Apache2::Status - Embedded interpreter status information




=head1 Synopsis

  <Location /perl-status>

      # disallow public access
      Order Deny, Allow
      Deny from all
      Allow from 127.0.0.1

      SetHandler modperl
      PerlOptions +GlobalRequest
      PerlResponseHandler Apache2::Status
  </Location>

  or

  <Location /perl-status>

      # disallow public access
      Order Deny, Allow
      Deny from all
      Allow from 127.0.0.1

      SetHandler perl-script
      PerlResponseHandler Apache2::Status
  </Location>




=head1 Description

The C<Apache2::Status> module provides some information
about the status of the Perl interpreter embedded in the server.

Configure like so:

  <Location /perl-status>

      # disallow public access
      Order Deny, Allow
      Deny from all
      Allow from 127.0.0.1

      SetHandler modperl
      PerlOptions +GlobalRequest
      PerlResponseHandler Apache2::Status
  </Location>

Notice that under the
C<L<"modperl"|docs::2.0::user::config::config/C_modperl_>> core
handler the I<Environment> menu option will show only the environment
under that handler. To see the environment seen by handlers running
under the
C<L<"perl-script"|docs::2.0::user::config::config/C_perl_script_>>
core handler, configure C<Apache2::Status> as:

  <Location /perl-status>

      # disallow public access
      Order Deny, Allow
      Deny from all
      Allow from 127.0.0.1

      SetHandler perl-script
      PerlResponseHandler Apache2::Status
  </Location>

Other modules can "plugin" a menu item like so:

  require Apache2::Module;
  Apache2::Status->menu_item(
      'DBI' => "DBI connections", #item for Apache::DBI module
      sub {
          my ($r, $q) = @_; #request and CGI objects
          my (@strings);
          push @strings,  "blobs of html";
          return \@strings;     #return an array ref
      }
  ) if Apache2::Module::loaded('Apache2::Status');

B<WARNING>: C<Apache2::Status> must be loaded before these modules via
the C<PerlModule> or C<PerlRequire> directives (or from
F<startup.pl>).

A very common setup might be:
  Perl Module B::TerseSize

  <Location /perl-status>
      SetHandler perl-script
      PerlResponseHandler Apache2::Status
      PerlSetVar StatusOptionsAll On
      PerlSetVar StatusDeparseOptions "-p -sC"
  </Location>

due to the implementation of Apache2::Status::noh_fileline in B::TerseSize,
you must load B::TerseSize first.

=head1 Options

=head2 C<StatusOptionsAll>

This single directive will enable all of the options described below.

  PerlSetVar StatusOptionsAll On

=head2 C<StatusDumper>

When browsing symbol tables, the values of arrays, hashes and scalars
can be viewed via C<Data::Dumper> if this configuration variable is
set to C<On>:

  PerlSetVar StatusDumper On

=head2 C<StatusPeek>

With this option C<On> and the C<Apache::Peek> module installed,
functions and variables can be viewed ala C<Devel::Peek> style:

  PerlSetVar StatusPeek On

=head2 C<StatusLexInfo>

With this option C<On> and the C<B::LexInfo> module installed,
subroutine lexical variable information can be viewed.

  PerlSetVar StatusLexInfo On

=head2 C<StatusDeparse>

With this option C<On> subroutines can be "deparsed".

  PerlSetVar StatusDeparse On

Options can be passed to C<B::Deparse::new> like so:

  PerlSetVar StatusDeparseOptions "-p -sC"

See the C<B::Deparse> manpage for details.

=head2 C<StatusTerse>

With this option C<On>, text-based op tree graphs of subroutines can
be displayed, thanks to C<B::Terse>.

  PerlSetVar StatusTerse On

=head2 C<StatusTerseSize>

With this option C<On> and the C<B::TerseSize> module installed,
text-based op tree graphs of subroutines and their size can be
displayed.  See the C<B::TerseSize> docs for more info.

  PerlSetVar StatusTerseSize On

=head2 C<StatusTerseSizeMainSummary>

With this option C<On> and the C<B::TerseSize> module installed, a
I<"Memory Usage"> will be added to the C<Apache2::Status> main menu.
This option is disabled by default, as it can be rather cpu intensive
to summarize memory usage for the entire server.  It is strongly
suggested that this option only be used with a development server
running in C<-X> mode, as the results will be cached.

  PerlSetVar StatusTerseSizeMainSummary On

=head2 C<StatusGraph>

When C<StatusDumper> is enabled, another link I<"OP Tree Graph"> will
be present with the dump if this configuration variable is set to
C<On>:

  PerlSetVar StatusGraph

This requires the B module (part of the Perl compiler kit) and
C<B::Graph> (version 0.03 or higher) module to be installed along with
the C<dot> program.

Dot is part of the graph visualization toolkit from AT&T:
http://www.graphviz.org/.

B<WARNING>: Some graphs may produce very large images, some graphs may
produce no image if C<B::Graph>'s output is incorrect.

=head2 C<Dot>

Location of the dot program for C<StatusGraph>,
if other than I</usr/bin> or I</usr/local/bin>

=head2 C<GraphDir>

Directory where C<StatusGraph> should write it's temporary image
files.  Default is C<$ServerRoot/logs/b_graphs>.






=head1 Prerequisites

The C<Devel::Symdump> module, version C<2.00> or higher.

Other optional functionality requirements: C<B::Deparse> - 0.59,
C<B::Fathom> - 0.05, C<C<B::Graph>> - 0.03.



=head1 Copyright

mod_perl 2.0 and its core modules are copyrighted under
The Apache Software License, Version 2.0.




=head1 See Also

perl(1), Apache(3), Devel::Symdump(3), Data::Dumper(3), B(3),
C<B::Graph>(3), L<mod_perl 2.0 documentation|docs::2.0::index>.




=head1 Authors

Doug MacEachern with contributions from Stas Bekman

=cut