MCPcopy Create free account
hub / github.com/apple/foundationdb / getWorkloadRates

Function getWorkloadRates

fdbcli/StatusCommand.actor.cpp:139–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139std::string getWorkloadRates(StatusObjectReader statusObj,
140 bool unknown,
141 std::string first,
142 std::string second,
143 bool transactionSection = false) {
144 // Re-point statusObj at either the transactions sub-doc or the operations sub-doc depending on transactionSection
145 // flag
146 if (transactionSection) {
147 if (!statusObj.get("transactions", statusObj))
148 return "unknown";
149 } else {
150 if (!statusObj.get("operations", statusObj))
151 return "unknown";
152 }
153
154 std::string path = first + "." + second;
155 double value;
156 if (!unknown && statusObj.get(path, value)) {
157 return format("%d Hz", (int)round(value));
158 }
159 return "unknown";
160}
161
162void getBackupDRTags(StatusObjectReader& statusObjCluster,
163 const char* context,

Callers 1

printStatusFunction · 0.85

Calls 2

getMethod · 0.65
formatFunction · 0.50

Tested by

no test coverage detected