[SIGAR-26] Change Pdh.getFormattedValue() to collect 2 counters if needed
This commit is contained in:
parent
d4f10e9cc7
commit
228ee133be
|
@ -1,4 +1,8 @@
|
|||
2006-12-03 Doug MacEachern <dougm@hyperic.net>
|
||||
2006-12-04 Doug MacEachern <dougm@hyperic.com>
|
||||
|
||||
* [SIGAR-26] Change Pdh.getFormattedValue() to collect 2 counters if needed
|
||||
|
||||
2006-12-03 Doug MacEachern <dougm@hyperic.com>
|
||||
|
||||
* [SIGAR-19] Change cpu time units to milliseconds
|
||||
|
||||
|
|
|
@ -173,10 +173,19 @@ JNIEXPORT jdouble SIGAR_JNI(win32_Pdh_pdhGetValue)
|
|||
}
|
||||
|
||||
if (fmt) {
|
||||
status = PdhGetFormattedCounterValue(h_counter,
|
||||
PDH_FMT_DOUBLE,
|
||||
(LPDWORD)NULL,
|
||||
&fmt_value);
|
||||
/* may require 2 counters, see msdn docs */
|
||||
int i=0;
|
||||
for (i=0; i<2; i++) {
|
||||
status = PdhGetFormattedCounterValue(h_counter,
|
||||
PDH_FMT_DOUBLE,
|
||||
(LPDWORD)NULL,
|
||||
&fmt_value);
|
||||
if (status == ERROR_SUCCESS) {
|
||||
break;
|
||||
}
|
||||
|
||||
PdhCollectQueryData(h_query);
|
||||
}
|
||||
}
|
||||
else {
|
||||
status = PdhGetRawCounterValue(h_counter, &type, &raw_value);
|
||||
|
|
Loading…
Reference in New Issue