| 3262 | } |
| 3263 | |
| 3264 | TSReturnCode |
| 3265 | TSMgmtCounterGet(const char *var_name, TSMgmtCounter *result) |
| 3266 | { |
| 3267 | auto res = RecGetRecordCounter(const_cast<char *>(var_name), static_cast<RecCounter *>(result)); |
| 3268 | |
| 3269 | // Try the old librecords first |
| 3270 | if (res == REC_ERR_FAIL) { |
| 3271 | int id = global_api_metrics.lookup(var_name); |
| 3272 | |
| 3273 | if (id == ts::Metrics::NOT_FOUND) { |
| 3274 | return TS_ERROR; |
| 3275 | } else { |
| 3276 | *result = global_api_metrics[id].load(); |
| 3277 | } |
| 3278 | } |
| 3279 | |
| 3280 | return TS_SUCCESS; |
| 3281 | } |
| 3282 | |
| 3283 | // ToDo: These don't have the new metrics, only librecords. |
| 3284 | TSReturnCode |