data/TWiki/MonitorDotPm.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 ---+ Package ==
     2 
     3 %TOC%
     4 Monitoring package. Instrument the code like this:
     5 
     6 use Monitor;
     7 Monitor::MARK("Description of event");
     8 Monitor::MARK("Another event");
     9 
    10 or, to monitor all the calls to a module
    11 
    12 use Monitor;
    13 Monitor::MonitorMethod('TWiki::Users');
    14 
    15 or a function
    16 
    17 use Monitor;
    18 Monitor::MonitorMethod('TWiki::Users', 'getCanonicalUserID');
    19 
    20 Then set the environment variable TWIKI_MONITOR to a perl true value, and
    21 run the script from the command line e.g:
    22 $ cd bin
    23 $ ./view -topic Myweb/MyTestTopic
    24 
    25 The results will be printed to STDERR at the end of the run. Two times are
    26 shown, a time relative to the last MARK and a time relative to the first MARK
    27 (which is always set the first time this package is used). The final column
    28 is total memory.
    29 
    30 NOTE: it uses /proc - so its linux specific...
    31