From 149a201c8e5d4dd0a39334b34cf293c7fb967fd8 Mon Sep 17 00:00:00 2001 From: Jacob Lisi Date: Tue, 7 Nov 2017 16:29:38 -0500 Subject: [PATCH] utils_format_graphite: add tests for graphite tag flag --- src/utils_format_graphite_test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/utils_format_graphite_test.c b/src/utils_format_graphite_test.c index a82142fa..42efa681 100644 --- a/src/utils_format_graphite_test.c +++ b/src/utils_format_graphite_test.c @@ -124,6 +124,22 @@ DEF_TEST(metric_name) { .suffix = NULL, .want_name = "foo.example@com.test.single", }, + /* flag GRAPHITE_USE_TAGS */ + {.flags = GRAPHITE_USE_TAGS, + .want_name = "test.single;host=example.com;plugin=test;type=single"}, + {.plugin_instance = "f.o.o", + .type_instance = "b.a.r", + .flags = GRAPHITE_USE_TAGS, + .want_name = "test.single;host=example.com;plugin=test;plugin_instance=" + "f.o.o;type=single;type_instance=b.a.r"}, + {.flags = GRAPHITE_USE_TAGS ^ GRAPHITE_ALWAYS_APPEND_DS, + .want_name = "test.single.value;host=example.com;plugin=test;type=" + "single;ds_name=value"}, + {.plugin_instance = "foo", + .type_instance = "foo", + .flags = GRAPHITE_USE_TAGS ^ GRAPHITE_DROP_DUPE_FIELDS, + .want_name = "test.single;host=example.com;plugin=test;plugin_instance=" + "foo;type=single"}, }; for (size_t i = 0; i < STATIC_ARRAY_SIZE(cases); i++) { -- 2.11.0