diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2011-07-05 20:20:26 -0400 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2011-07-05 20:20:26 -0400 | 
| commit | bfbd7c6df5d00b40a5a36fe7d99527084f19e76d (patch) | |
| tree | efcbc744354c6c614b10f7651e557b1fcbdec917 /indra/llcommon | |
| parent | abf50e8c7d3cf0bab46286f4b300c7d3be976775 (diff) | |
CHOP-753: On Windows, add GetPerformanceInfo to LLMemoryInfo stats.
So far we've only been querying GlobalMemoryStatusEx(), but
GetPerformanceInfo() delivers a bunch more memory-related stats that may be
pertinent. Try capturing those too. May not yet compile on Windows...
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/llsys.cpp | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index d02a807000..e0ce74234d 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -58,6 +58,7 @@ using namespace llsd;  #	define WIN32_LEAN_AND_MEAN  #	include <winsock2.h>  #	include <windows.h> +#   include <psapi.h>  #elif LL_DARWIN  #	include <errno.h>  #	include <sys/sysctl.h> @@ -873,6 +874,25 @@ LLSD LLMemoryInfo::loadStatsArray()  	statsArray.append(LLSDArray("Total Virtual KB")  (LLSD::Integer(state.ullTotalVirtual/1024)));  	statsArray.append(LLSDArray("Avail Virtual KB")  (LLSD::Integer(state.ullAvailVirtual/1024))); +	PERFORMANCE_INFORMATION perf; +	perf.cb = sizeof(perf); +	GetPerformanceInfo(&perf, sizeof(perf)); + +	SIZE_T pagekb(perf.PageSize/1024); +	statsArray.append(LLSDArray("CommitTotal KB")	(LLSD::Integer(perf.CommitTotal * pagekb))); +	statsArray.append(LLSDArray("CommitLimit KB")	(LLSD::Integer(perf.CommitLimit * pagekb))); +	statsArray.append(LLSDArray("CommitPeak KB")	(LLSD::Integer(perf.CommitPeak * pagekb))); +	statsArray.append(LLSDArray("PhysicalTotal KB") (LLSD::Integer(perf.PhysicalTotal * pagekb))); +	statsArray.append(LLSDArray("PhysicalAvail KB") (LLSD::Integer(perf.PhysicalAvailable * pagekb))); +	statsArray.append(LLSDArray("SystemCache KB")	(LLSD::Integer(perf.SystemCache * pagekb))); +	statsArray.append(LLSDArray("KernelTotal KB")	(LLSD::Integer(perf.KernelTotal * pagekb))); +	statsArray.append(LLSDArray("KernelPaged KB")	(LLSD::Integer(perf.KernelPaged * pagekb))); +	statsArray.append(LLSDArray("KernelNonpaged KB")(LLSD::Integer(perf.KernelNonpaged * pagekb))); +	statsArray.append(LLSDArray("PageSize KB")		(LLSD::Integer(pagekb))); +	statsArray.append(LLSDArray("HandleCount")		(LLSD::Integer(perf.HandleCount))); +	statsArray.append(LLSDArray("ProcessCount")		(LLSD::Integer(perf.ProcessCount))); +	statsArray.append(LLSDArray("ThreadCount")		(LLSD::Integer(perf.ThreadCount))); +  #elif LL_DARWIN  	uint64_t phys = 0;  | 
