sysinfo: add memory stats for posix platforms
This commit is contained in:
parent
c79b0bae22
commit
e73d42e817
@ -40,5 +40,13 @@ cruft::util::operator<< (std::ostream &os, sysinfo const &)
|
|||||||
os << ", username: " << user->pw_name;
|
os << ", username: " << user->pw_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
auto const size = posix::error::try_call (sysconf, _SC_PAGESIZE);
|
||||||
|
auto const total = posix::error::try_call (sysconf, _SC_PHYS_PAGES);
|
||||||
|
auto const now = posix::error::try_call (sysconf, _SC_AVPHYS_PAGES);
|
||||||
|
|
||||||
|
os << ", ram: { total: " << size * total << ", available: " << size * now << " },";
|
||||||
|
}
|
||||||
|
|
||||||
return os << " }";
|
return os << " }";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user