X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_format_graphite_test.c;h=42efa681654deb06774d1048d39892621d8d44d9;hb=7c9d772c992647fcba64a96800c146eb9f1647f8;hp=a82142fa100c1b23a016c2e1f0ad5af1e7aa80ee;hpb=0eff2a882a9265fd59d4f7a265c6b6810acb0032;p=collectd.git 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++) {