MCPcopy Create free account
hub / github.com/apache/trafficserver / TSMgmtCounterGet

Function TSMgmtCounterGet

src/api/InkAPI.cc:3264–3281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3262}
3263
3264TSReturnCode
3265TSMgmtCounterGet(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.
3284TSReturnCode

Callers 2

ts_lua_mgmt_get_counterFunction · 0.85

Calls 3

RecGetRecordCounterFunction · 0.85
lookupMethod · 0.45
loadMethod · 0.45

Tested by 1