data/TWiki/MonitorDotPm.txt
changeset 0 414e01d06fd5
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     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