Gather a bit more information from sysinfo()
commitda47be597be6a59e9e86202d041a85c274308edf
authorLucian Wischik <ljw@fb.com>
Tue, 31 May 2022 15:42:33 +0000 (31 08:42 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 31 May 2022 15:42:33 +0000 (31 08:42 -0700)
treeb2bd43e7c3ddf72ff43b3c57ba18c32528579925
parent9cb61feb5bf14bb275e28acfdda0575d4b30cd38
Gather a bit more information from sysinfo()

Summary:
What I've been seeing is that hh_server memory.current + memory.swap.current was only a modest 30gb (and its memory.swap.current was only 2gb), but the machine as a whole -- which was supposed to be running solely hack -- nevertheless had 16gb of swap used and it OOMed.

It's an ongoing quest to find out what's up. But as a starting point, I'd like hack telemetry to be able to show machinewide memory+swap. That'll at least let us point fingers and say "not us". It'll also give us an idea of how heavily occupied the machine is other than hh_server's own contribution.

This diff is just a small first step. It changes sysinfo.c to return most of the fields from sysinfo(), rather than just two. I believe that sysinfo() is the right way to gather information about machine ran and swap use.

I also moved nproc.c into sysinfo.c since it felt pretty similar.

Differential Revision: D36715952

fbshipit-source-id: 186d2b46855955c161c67f6bd804e94e305df306
hphp/hack/src/facts/symbols/indexBuilder.ml
hphp/hack/src/utils/sys/dune
hphp/hack/src/utils/sys/nproc.c [deleted file]
hphp/hack/src/utils/sys/sys_utils.ml
hphp/hack/src/utils/sys/sys_utils.mli
hphp/hack/src/utils/sys/sysinfo.c