data/TWiki/MonitorDotPm.txt
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/data/TWiki/MonitorDotPm.txt	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +---+ Package ==
     1.5 +
     1.6 +%TOC%
     1.7 +Monitoring package. Instrument the code like this:
     1.8 +
     1.9 +use Monitor;
    1.10 +Monitor::MARK("Description of event");
    1.11 +Monitor::MARK("Another event");
    1.12 +
    1.13 +or, to monitor all the calls to a module
    1.14 +
    1.15 +use Monitor;
    1.16 +Monitor::MonitorMethod('TWiki::Users');
    1.17 +
    1.18 +or a function
    1.19 +
    1.20 +use Monitor;
    1.21 +Monitor::MonitorMethod('TWiki::Users', 'getCanonicalUserID');
    1.22 +
    1.23 +Then set the environment variable TWIKI_MONITOR to a perl true value, and
    1.24 +run the script from the command line e.g:
    1.25 +$ cd bin
    1.26 +$ ./view -topic Myweb/MyTestTopic
    1.27 +
    1.28 +The results will be printed to STDERR at the end of the run. Two times are
    1.29 +shown, a time relative to the last MARK and a time relative to the first MARK
    1.30 +(which is always set the first time this package is used). The final column
    1.31 +is total memory.
    1.32 +
    1.33 +NOTE: it uses /proc - so its linux specific...
    1.34 +