Everything is in KB
This commit is contained in:
parent
191b054ff0
commit
75362450cd
1 changed files with 9 additions and 9 deletions
|
@ -18,13 +18,13 @@ v8::Local<v8::Value> GetProcessMetrics(v8::Isolate* isolate) {
|
||||||
std::unique_ptr<base::ProcessMetrics> metrics(
|
std::unique_ptr<base::ProcessMetrics> metrics(
|
||||||
base::ProcessMetrics::CreateCurrentProcessMetrics());
|
base::ProcessMetrics::CreateCurrentProcessMetrics());
|
||||||
|
|
||||||
dict.Set("workingSetSize", (double)metrics->GetWorkingSetSize());
|
dict.Set("workingSetSize", (double)(metrics->GetWorkingSetSize() >> 10));
|
||||||
dict.Set("peakWorkingSetSize", (double)metrics->GetPeakWorkingSetSize());
|
dict.Set("peakWorkingSetSize", (double)(metrics->GetPeakWorkingSetSize() >> 10));
|
||||||
|
|
||||||
size_t private_bytes, shared_bytes;
|
size_t private_bytes, shared_bytes;
|
||||||
if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) {
|
if (metrics->GetMemoryBytes(&private_bytes, &shared_bytes)) {
|
||||||
dict.set("privateBytes", (double)private_bytes);
|
dict.Set("privateBytes", (double)(private_bytes >> 10));
|
||||||
dict.set("sharedBytes", (double)shared_bytes);
|
dict.Set("sharedBytes", (double)(shared_bytes >> 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
return dict.GetHandle();
|
return dict.GetHandle();
|
||||||
|
@ -39,13 +39,13 @@ v8::Local<v8::Value> GetSystemMemoryInfo(v8::Isolate* isolate, mate::Arguments*
|
||||||
return v8::Undefined(isolate);
|
return v8::Undefined(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
dict.set("total", memInfo.total);
|
dict.Set("total", memInfo.total);
|
||||||
dict.set("free", memInfo.free);
|
dict.Set("free", memInfo.free);
|
||||||
|
|
||||||
// NB: These return bogus values on OS X
|
// NB: These return bogus values on OS X
|
||||||
#if !DEFINED(OS_MACOSX)
|
#if !defined(OS_MACOSX)
|
||||||
dict.set("swapTotal", memInfo.swap_total);
|
dict.Set("swapTotal", memInfo.swap_total);
|
||||||
dict.set("swapFree", memInfo.swap_free);
|
dict.Set("swapFree", memInfo.swap_free);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return dict.GetHandle();
|
return dict.GetHandle();
|
||||||
|
|
Loading…
Reference in a new issue