Commit 362229f1 authored by David Goulet's avatar David Goulet 🐼
Browse files

lib/metrics: Fix wrong macro expansion

The "METRICS_PREFIX" was not expanded but rather used as a litteral. Fix that
by just removing the define and using "tor_" directly.

Reviewed-by: Alexander Færøy's avatarAlexander Færøy <>
Signed-off-by: David Goulet's avatarDavid Goulet <>
parent 5de66739
......@@ -11,14 +11,10 @@
#include "lib/cc/torint.h"
/** Prefix to every metrics exposed. This is insures that the metrics are
* always in the same namespace. */
#define METRICS_PREFIX tor_
/** Helper macro that must be used to construct the right namespaced metrics
* name. A name is a string so stringify the result. */
#define METRICS_STR(val) #val
#define METRICS_NAME(name) METRICS_STR(tor_ ## name)
/** Format output type. */
typedef enum {
......@@ -44,7 +44,7 @@ test_metrics(void *arg)
/* Confirm the entry value. */
const smartlist_t *entries = metrics_store_get_all(service->,
tt_int_op(smartlist_len(entries), OP_EQ, 1);
const metrics_store_entry_t *entry = smartlist_get(entries, 0);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment