1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add comments for utility, the USER_HZ for /proc/stat

This commit is contained in:
winlin 2014-07-27 11:44:48 +08:00
parent 6d9d9ee3c5
commit a645b403c8
2 changed files with 39 additions and 2 deletions

View file

@ -283,6 +283,17 @@ bool get_proc_self_stat(SrsProcSelfStat& r)
void srs_update_proc_stat()
{
// always assert the USER_HZ is 1/100ths
// @see: http://stackoverflow.com/questions/7298646/calculating-user-nice-sys-idle-iowait-irq-and-sirq-from-proc-stat/7298711
static bool user_hz_assert = false;
if (!user_hz_assert) {
user_hz_assert = true;
int USER_HZ = sysconf(_SC_CLK_TCK);
srs_trace("USER_HZ=%d", USER_HZ);
srs_assert(USER_HZ == 100);
}
// system cpu stat
if (true) {
SrsProcSystemStat r;