// Cpuacct TError TCpuacctSubsystem::Usage(TCgroup &cg, uint64_t &value) const { std::string s; TError error = cg.Get("cpuacct.usage", s); if (error) return error; return StringToUint64(s, value); }
// Freezer TError TFreezerSubsystem::WaitState(TCgroup &cg, const std::string &state) const { uint64_t deadline = GetCurrentTimeMs() + config().daemon().freezer_wait_timeout_s() * 1000; std::string cur; TError error; do { error = cg.Get("freezer.state", cur); if (error || StringTrim(cur) == state) return error; } while (!WaitDeadline(deadline)); return TError(EError::Unknown, "Freezer " + cg.Name + " timeout waiting " + state); }
bool TFreezerSubsystem::IsFrozen(TCgroup &cg) const { std::string state; return !cg.Get("freezer.state", state) && StringTrim(state) != "THAWED"; }