mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8351359: OperatingSystemMXBean: values from getCpuLoad and getProcessCpuLoad are stale after 24.8 days (Windows)
Reviewed-by: amenkov, sspitsyn
This commit is contained in:
parent
ad07426fab
commit
900b3ff7ee
@ -50,6 +50,8 @@
|
||||
#include <process.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <sysinfoapi.h>
|
||||
|
||||
typedef unsigned __int32 juint;
|
||||
typedef unsigned __int64 julong;
|
||||
|
||||
@ -215,10 +217,10 @@ static PdhLookupPerfNameByIndexFunc PdhLookupPerfNameByIndex_i;
|
||||
*/
|
||||
typedef struct {
|
||||
HQUERY query;
|
||||
uint64_t lastUpdate; // Last time query was updated (ticks)
|
||||
uint64_t lastUpdate; // Last time query was updated (millis)
|
||||
} UpdateQueryS, *UpdateQueryP;
|
||||
|
||||
// Min time between query updates (ticks)
|
||||
// Min time between query updates (millis)
|
||||
static const int MIN_UPDATE_INTERVAL = 500;
|
||||
|
||||
/*
|
||||
@ -991,7 +993,7 @@ bindPdhFunctionPointers(HMODULE h) {
|
||||
*/
|
||||
static int
|
||||
getPerformanceData(UpdateQueryP query, HCOUNTER c, PDH_FMT_COUNTERVALUE* value, DWORD format) {
|
||||
clock_t now = clock();
|
||||
uint64_t now = GetTickCount64();
|
||||
|
||||
/*
|
||||
* Need to limit how often we update the query
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user