gbproxy_peer: Set rate_ctr name for gbproxy_peer stats

Change-Id: I60a5a208ab69ad1184ba643d063717a46a90b131
This commit is contained in:
Daniel Willmann 2021-07-09 13:58:58 +02:00
parent f024eeb9e7
commit 990b151fbb
1 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,7 @@ struct gbproxy_bvc *gbproxy_bvc_by_bvci(struct gbproxy_nse *nse, uint16_t bvci)
struct gbproxy_bvc *gbproxy_bvc_alloc(struct gbproxy_nse *nse, uint16_t bvci)
{
char idbuf[64];
struct gbproxy_bvc *bvc;
OSMO_ASSERT(nse);
struct gbproxy_config *cfg = nse->cfg;
@ -79,12 +80,16 @@ struct gbproxy_bvc *gbproxy_bvc_alloc(struct gbproxy_nse *nse, uint16_t bvci)
if (!bvc)
return NULL;
snprintf(idbuf, sizeof(idbuf), "BVC%05u-NSE%05u", bvci,
nse->nsei);
osmo_identifier_sanitize_buf(idbuf, NULL, '_');
bvc->bvci = bvci;
bvc->ctrg = rate_ctr_group_alloc(bvc, &bvc_ctrg_desc, (nse->nsei << 16) | bvci);
if (!bvc->ctrg) {
talloc_free(bvc);
return NULL;
}
rate_ctr_group_set_name(bvc->ctrg, idbuf);
bvc->nse = nse;
hash_add(nse->bvcs, &bvc->list, bvc->bvci);