From 053b2867bde69ce9fa036e5e1a671836073d08ec Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 21 Jul 2020 19:01:08 +0200 Subject: [PATCH] cmds: migrate to metric_parse_identity(). --- src/utils/cmds/getthreshold.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/cmds/getthreshold.c b/src/utils/cmds/getthreshold.c index d7a350ca2..be12d18ba 100644 --- a/src/utils/cmds/getthreshold.c +++ b/src/utils/cmds/getthreshold.c @@ -74,9 +74,8 @@ int handle_getthreshold(FILE *fh, char *buffer) { return -1; } - metric_family_t *fam = - metric_family_unmarshal_text(identifier, METRIC_TYPE_UNTYPED); - if (fam == NULL) { + metric_t *m = metric_parse_identity(identifier); + if (m == NULL) { print_to_socket(fh, "-1 Parsing metric identity failed: %s.\n", STRERRNO); return -1; } @@ -84,7 +83,8 @@ int handle_getthreshold(FILE *fh, char *buffer) { threshold_t threshold = { .flags = 0, }; - status = ut_search_threshold(fam->metric.ptr, &threshold); + status = ut_search_threshold(m, &threshold); + metric_family_free(m->family); if (status == ENOENT) { print_to_socket(fh, "-1 No threshold found for identifier %s\n", identifier); -- 2.47.2