| 3243 | } |
| 3244 | |
| 3245 | TSReturnCode |
| 3246 | TSMgmtIntGet(const char *var_name, TSMgmtInt *result) |
| 3247 | { |
| 3248 | auto res = RecGetRecordInt(const_cast<char *>(var_name), static_cast<RecInt *>(result)); |
| 3249 | |
| 3250 | // Try the old librecords first |
| 3251 | if (res == REC_ERR_FAIL) { |
| 3252 | int id = global_api_metrics.lookup(var_name); |
| 3253 | |
| 3254 | if (id == ts::Metrics::NOT_FOUND) { |
| 3255 | return TS_ERROR; |
| 3256 | } else { |
| 3257 | *result = global_api_metrics[id].load(); |
| 3258 | } |
| 3259 | } |
| 3260 | |
| 3261 | return TS_SUCCESS; |
| 3262 | } |
| 3263 | |
| 3264 | TSReturnCode |
| 3265 | TSMgmtCounterGet(const char *var_name, TSMgmtCounter *result) |