Skip to content

Commit c9b78dd

Browse files
Added totalRamSize and currentProcessRamUsage
1 parent a331ff0 commit c9b78dd

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

client/src/bindings/SystemInfo.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,26 @@ static void GetRAMUsage(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8
2424
V8_RETURN_NUMBER(alt::ICore::Instance().GetRAMUsage());
2525
}
2626

27+
static void GetTotalRAM(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
28+
{
29+
V8_GET_ISOLATE_CONTEXT();
30+
31+
V8_RETURN_NUMBER(alt::ICore::Instance().GetTotalRAM());
32+
}
33+
34+
static void GetCurrentProcessRamUsage(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
35+
{
36+
V8_GET_ISOLATE_CONTEXT();
37+
38+
V8_RETURN_NUMBER(alt::ICore::Instance().GetCurrentProcessRamUsage());
39+
}
2740

2841
extern V8Class v8SystemInfo("SystemInfo", [](v8::Local<v8::FunctionTemplate> tpl) {
2942
v8::Isolate* isolate = v8::Isolate::GetCurrent();
3043

3144
V8Helpers::SetStaticAccessor(isolate, tpl, "cpuLoad", GetCpuLoad, nullptr);
3245
V8Helpers::SetStaticAccessor(isolate, tpl, "videoMemoryUsage", GetVideoMemoryUsage, nullptr);
3346
V8Helpers::SetStaticAccessor(isolate, tpl, "ramUsage", GetRAMUsage, nullptr);
47+
V8Helpers::SetStaticAccessor(isolate, tpl, "totalRamSize", GetTotalRAM, nullptr);
48+
V8Helpers::SetStaticAccessor(isolate, tpl, "currentProcessRamUsage", GetCurrentProcessRamUsage, nullptr);
3449
});

0 commit comments

Comments
 (0)