MCPcopy Create free account
hub / github.com/DFHack/dfhack / getStatus

Method getStatus

plugins/suspendmanager.cpp:631–646  ·  view source on GitHub ↗

gather some statistics about the last call to do_cycle()

Source from the content-addressed store, hash-verified

629
630 // gather some statistics about the last call to do_cycle()
631 string getStatus (color_ostream &out) {
632 std::map<Reason,int> stats;
633
634 for (auto [_ , reason] : suspensions) {
635 stats[reason == Reason::DEADEND ? Reason::RISK_BLOCKING : reason]++;
636 }
637
638 std::stringstream res;
639 res << "suspended " << num_suspend << " and unsuspended " << num_unsuspend << " jobs\n";
640 res << "maintaining " << suspensions.size() << " suspension reasons\n";
641 for (auto stat : stats) {
642 res << std::setw(5) << stat.second << "x " << reasonToString(stat.first) << std::endl;
643 }
644
645 return res.str();
646 }
647
648 void refresh(color_ostream &out)
649 {

Callers 2

do_commandFunction · 0.80
suspendmanager_getStatusFunction · 0.80

Calls 3

reasonToStringFunction · 0.85
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected