%PerfCounter, %PerfCounterR functions
Related pages:
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 local computer, the first part
giving the computer name may 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 wrong values (0).
If there is the need to call function each second for more system
information, we recommend you to execute each calling on the different
line in 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 delay 0.1 second if the value 0 has been loaded at first calling:
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
Related pages:
Pridať komentár