MCPcopy Create free account
hub / github.com/78/tenbox / VmResources

Method VmResources

src/daemon/rpc_server.cpp:445–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445nlohmann::json RpcServer::VmResources(const VmRecord& record) const {
446 nlohmann::json out = {
447 {"disk_usage_bytes", DirectorySizeBytes(record.spec.vm_dir)},
448 };
449 if (record.runtime.pid > 0 && record.runtime.state == VmState::kRunning) {
450 out["process"] = ToJson(runtime_manager_.SampleProcessResources(record.spec.vm_id));
451 }
452 return out;
453}
454
455} // namespace tenbox::daemon

Callers

nothing calls this directly

Calls 3

DirectorySizeBytesFunction · 0.85
ToJsonFunction · 0.70

Tested by

no test coverage detected