MCPcopy Create free account
hub / github.com/Alexays/Waybar / getLoad

Method getLoad

src/modules/load.cpp:52–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52std::tuple<double, double, double> waybar::modules::Load::getLoad() {
53 double load[3];
54 if (getloadavg(load, 3) != -1) {
55 double load1 = std::ceil(load[0] * 100.0) / 100.0;
56 double load5 = std::ceil(load[1] * 100.0) / 100.0;
57 double load15 = std::ceil(load[2] * 100.0) / 100.0;
58 return {load1, load5, load15};
59 }
60 throw std::runtime_error("Can't get system load");
61}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected