| 137 | } |
| 138 | |
| 139 | std::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 | |
| 162 | void getBackupDRTags(StatusObjectReader& statusObjCluster, |
| 163 | const char* context, |
no test coverage detected