MCPcopy Create free account
hub / github.com/apache/mesos / busy

Function busy

src/linux/cgroups.cpp:527–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525
526
527Try<bool> busy(const string& subsystems)
528{
529 Try<map<string, internal::SubsystemInfo>> infosResult =
530 internal::subsystems();
531 if (infosResult.isError()) {
532 return Error(infosResult.error());
533 }
534
535 map<string, internal::SubsystemInfo> infos = infosResult.get();
536 bool busy = false;
537
538 foreach (const string& subsystem, strings::tokenize(subsystems, ",")) {
539 if (infos.find(subsystem) == infos.end()) {
540 return Error("'" + subsystem + "' not found");
541 }
542 if (infos[subsystem].hierarchy != 0) {
543 // Here, we don't return false immediately because we want to return
544 // error if any of the given subsystems is missing.
545 busy = true;
546 }
547 }
548
549 return busy;
550}
551
552
553Try<set<string>> subsystems()

Callers 2

TEST_FFunction · 0.85
foreachFunction · 0.85

Calls 5

subsystemsFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.68