data/TWiki/MonitorDotPm.txt
author Colas Nahaboo <colas@nahaboo.net>
Mon, 11 Aug 2008 20:33:37 +0200
changeset 2 7bc60a767fa4
parent 0 414e01d06fd5
permissions -rw-r--r--
TWiki-4.2.2 Release
     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