attachment upload
[openafs-wiki.git] / TWiki / MonitorDotPm.mdwn
1 # <a name="Package &lt;code&gt;="></a> Package =
2
3 <div>
4   <ul>
5     <li><a href="#Package =="> Package ==</a></li>
6   </ul>
7 </div>
8
9 Monitoring package. Instrument the code like this:
10
11 use Monitor; Monitor::MARK("Description of event"); Monitor::MARK("Another event");
12
13 or, to monitor all the calls to a module
14
15 use Monitor; Monitor::MonitorMethod('TWiki::Users');
16
17 or a function
18
19 use Monitor; Monitor::MonitorMethod('TWiki::Users', 'getCanonicalUserID');
20
21 Then set the environment variable TWIKI\_MONITOR to a perl true value, and run the script from the command line e.g: $ cd bin $ ./view -topic Myweb/MyTestTopic
22
23 The results will be printed to STDERR at the end of the run. Two times are shown, a time relative to the last MARK and a time relative to the first MARK (which is always set the first time this package is used). The final column is total memory.
24
25 NOTE: it uses /proc - so its linux specific...