INT %PerfCounter( TEXT in text ) |
REAL %PerfCounterR( TEXT in text ) |
text | Performance Counter definition. |
\\ComputerName\Object(instance)\Counter.
If you want to monitor the counter on a local computer, the first part giving the computer name may be omitted. If an object has only one instance, the part "instance" is omitted.
If the function %PerfCounter (%PerfCounterR) is called frequently (more times than once per second), it returns the wrong values (0).
If there is the need to call the function each second for more system information, we recommend executing each function call on the different line in the ESL script.
%PerfCounter("\D2000 Server\MemUsed") ; returns the memory size used by process D2000 Server |
This is an example of the code which calls %PerfCounter twice with the delay of 0.1 seconds if the value 0 has been read during the first call:
INT _i REAL _result FOR _i=1 TO 2 DO_LOOP _result := %PerfCounter("\Processor(_Total)\% User Time") IF _result\VLD THEN IF _result=0 & _i=1 THEN ; workaround - at first calling (e.g. it returns 0 on \Processor (_Total)\% User Time) DELAY 0.1 [s] ELSE EXIT_LOOP ENDIF ELSE EXIT_LOOP ENDIF END_LOOP |
INT _i REAL _result _result := %PerfCounter(_counter) IF _result\VLD THEN IF _result=0 THEN ; NONFUNCTIONAL workaround - at first calling (e.g. it returns 0 on \Processor(_Total)\% User Time) DELAY 0.05 [s] _result := %PerfCounter(_counter) ENDIF ENDIF |