Skip to content

Commit

Permalink
Added totalRamSize and currentProcessRamUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
libragliese581 committed Dec 28, 2024
1 parent 194681b commit ba09c94
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions client/src/bindings/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,26 @@ static void GetRAMUsage(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8
V8_RETURN_NUMBER(alt::ICore::Instance().GetRAMUsage());
}

static void GetTotalRAM(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();

V8_RETURN_NUMBER(alt::ICore::Instance().GetTotalRAM());
}

static void GetCurrentProcessRamUsage(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
V8_GET_ISOLATE_CONTEXT();

V8_RETURN_NUMBER(alt::ICore::Instance().GetCurrentProcessRamUsage());
}

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

V8Helpers::SetStaticAccessor(isolate, tpl, "cpuLoad", GetCpuLoad, nullptr);
V8Helpers::SetStaticAccessor(isolate, tpl, "videoMemoryUsage", GetVideoMemoryUsage, nullptr);
V8Helpers::SetStaticAccessor(isolate, tpl, "ramUsage", GetRAMUsage, nullptr);
V8Helpers::SetStaticAccessor(isolate, tpl, "totalRamSize", GetTotalRAM, nullptr);
V8Helpers::SetStaticAccessor(isolate, tpl, "currentProcessRamUsage", GetCurrentProcessRamUsage, nullptr);
});
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk
Submodule cpp-sdk updated 2 files
+2 −0 ICore.h
+0 −50 system/ISystemInfoAPI.h

0 comments on commit ba09c94

Please sign in to comment.