Code

Merged branch 'master' of git://git.tokkee.org/sysdb.
authorSebastian Harl <sh@tokkee.org>
Fri, 15 May 2015 20:53:44 +0000 (22:53 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 15 May 2015 20:53:44 +0000 (22:53 +0200)
src/core/plugin.c
src/core/store.c
t/unit/core/store_expr_test.c
t/unit/core/store_json_test.c
t/unit/frontend/query_test.c

index bf0bdb34a20af428c73ab63250c7b0f4d3f4c00b..f581eb1629fbe3f043c02e13f6a4f3799de9b6d4 100644 (file)
@@ -1386,7 +1386,7 @@ sdb_plugin_store_metric(const char *hostname, const char *name,
        if ((! hostname) || (! name))
                return -1;
 
-       if ((! store->type) || (! store->id))
+       if (store && ((! store->type) || (! store->id)))
                store = NULL;
 
        iter = sdb_llist_get_iter(writer_list);
index a1cf8f6bc44b6ba816fc66ee729189c4371da07d..eb58ad83b1ba2cd36b5fba803e42313758ea3d38 100644 (file)
@@ -423,6 +423,37 @@ store_attr(sdb_store_obj_t *parent, sdb_avltree_t *attributes,
        return status;
 } /* store_attr */
 
+static int
+store_metric_store(sdb_metric_t *metric, sdb_metric_store_t *store)
+{
+       char *type = metric->store.type;
+       char *id = metric->store.id;
+
+       if ((! metric->store.type) || strcasecmp(metric->store.type, store->type)) {
+               if (! (type = strdup(store->type)))
+                       return -1;
+       }
+       if ((! metric->store.id) || strcasecmp(metric->store.id, store->id)) {
+               if (! (id = strdup(store->id))) {
+                       if (type != metric->store.type)
+                               free(type);
+                       return -1;
+               }
+       }
+
+       if (type != metric->store.type) {
+               if (metric->store.type)
+                       free(metric->store.type);
+               metric->store.type = type;
+       }
+       if (id != metric->store.id) {
+               if (metric->store.id)
+                       free(metric->store.id);
+               metric->store.id = id;
+       }
+       return 0;
+} /* store_metric_store */
+
 /* The host_lock has to be acquired before calling this function. */
 static sdb_avltree_t *
 get_host_children(sdb_host_t *host, int type)
@@ -609,6 +640,7 @@ sdb_store_service(const char *hostname, const char *name,
 {
        sdb_host_t *host;
        sdb_avltree_t *services;
+       sdb_data_t d;
 
        int status = 0;
 
@@ -631,8 +663,17 @@ sdb_store_service(const char *hostname, const char *name,
        sdb_object_deref(SDB_OBJ(host));
        pthread_rwlock_unlock(&host_lock);
 
+       if (status)
+               return status;
+
        if (sdb_plugin_store_service(hostname, name, last_update))
                status = -1;
+
+       /* record the hostname as an attribute */
+       d.type = SDB_TYPE_STRING;
+       d.data.string = SDB_OBJ(host)->name;
+       if (sdb_store_service_attr(hostname, name, "hostname", &d, last_update))
+               status = -1;
        return status;
 } /* sdb_store_service */
 
@@ -687,6 +728,7 @@ sdb_store_metric(const char *hostname, const char *name,
        sdb_store_obj_t *obj = NULL;
        sdb_host_t *host;
        sdb_metric_t *metric;
+       sdb_data_t d;
 
        sdb_avltree_t *metrics;
 
@@ -716,7 +758,7 @@ sdb_store_metric(const char *hostname, const char *name,
                                name, last_update, &obj);
        sdb_object_deref(SDB_OBJ(host));
 
-       if (status || (! store)) {
+       if (status) {
                pthread_rwlock_unlock(&host_lock);
                return status;
        }
@@ -724,29 +766,19 @@ sdb_store_metric(const char *hostname, const char *name,
        assert(obj);
        metric = METRIC(obj);
 
-       if ((! metric->store.type) || strcasecmp(metric->store.type, store->type)) {
-               if (metric->store.type)
-                       free(metric->store.type);
-               metric->store.type = strdup(store->type);
-       }
-       if ((! metric->store.id) || strcasecmp(metric->store.id, store->id)) {
-               if (metric->store.id)
-                       free(metric->store.id);
-               metric->store.id = strdup(store->id);
-       }
-
-       if ((! metric->store.type) || (! metric->store.id)) {
-               if (metric->store.type)
-                       free(metric->store.type);
-               if (metric->store.id)
-                       free(metric->store.id);
-               metric->store.type = metric->store.id = NULL;
-               status = -1;
-       }
+       if (store)
+               if (store_metric_store(metric, store))
+                       status = -1;
        pthread_rwlock_unlock(&host_lock);
 
        if (sdb_plugin_store_metric(hostname, name, store, last_update))
                status = -1;
+
+       /* record the hostname as an attribute */
+       d.type = SDB_TYPE_STRING;
+       d.data.string = SDB_OBJ(host)->name;
+       if (sdb_store_metric_attr(hostname, name, "hostname", &d, last_update))
+               status = -1;
        return status;
 } /* sdb_store_metric */
 
index 5de5fdd0b4e877b1501de2662eb0e22fc91d4d5f..48c128c0573b5943e2fdfec200958be71e51bb64 100644 (file)
@@ -309,23 +309,23 @@ struct {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
                "a", SDB_SERVICE, "s1", NULL,
                {
+                       { SDB_TYPE_STRING, { .string = "hostname" } },
                        { SDB_TYPE_STRING, { .string = "k1" } },
                        { 0 },
                        { 0 },
                        { 0 },
-                       { 0 },
-               }, 1,
+               }, 2,
        },
        {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
                "a", SDB_SERVICE, "s1", "age >= 0s",
                {
+                       { SDB_TYPE_STRING, { .string = "hostname" } },
                        { SDB_TYPE_STRING, { .string = "k1" } },
                        { 0 },
                        { 0 },
                        { 0 },
-                       { 0 },
-               }, 1,
+               }, 2,
        },
        {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
@@ -378,23 +378,23 @@ struct {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
                "b", SDB_METRIC, "m2", NULL,
                {
+                       { SDB_TYPE_STRING, { .string = "hostname" } },
                        { SDB_TYPE_STRING, { .string = "k1" } },
                        { SDB_TYPE_STRING, { .string = "k2" } },
                        { 0 },
                        { 0 },
-                       { 0 },
-               }, 2,
+               }, 3,
        },
        {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
                "b", SDB_METRIC, "m2", "age >= 0s",
                {
+                       { SDB_TYPE_STRING, { .string = "hostname" } },
                        { SDB_TYPE_STRING, { .string = "k1" } },
                        { SDB_TYPE_STRING, { .string = "k2" } },
                        { 0 },
                        { 0 },
-                       { 0 },
-               }, 2,
+               }, 3,
        },
        {
                { SDB_OBJECT_INIT, TYPED_EXPR, -1, &namer, NULL, ATTRS }, true,
index ff6a18edc3ae8f095988129231430b893a0a5b03..704ad067fc52d9fba04a8ea5bbe901a3013583c6 100644 (file)
@@ -124,8 +124,7 @@ verify_json_output(sdb_strbuf_t *buf, const char *expected)
 
 struct {
        struct {
-               sdb_store_matcher_t *(*m)(sdb_store_expr_t *,
-                               sdb_store_expr_t *);
+               sdb_store_matcher_t *(*m)(sdb_store_expr_t *, sdb_store_expr_t *);
                int field;
                sdb_data_t value;
        } filter;
@@ -155,6 +154,9 @@ struct {
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k3\", \"value\": 42, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []}"
@@ -162,7 +164,12 @@ struct {
                                        "{\"name\": \"m2\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "]},"
                        "{\"name\": \"h2\", \"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                "\"update_interval\": \"0s\", \"backends\": [], "
@@ -170,16 +177,29 @@ struct {
                                        "{\"name\": \"m1\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "], "
                                "\"services\": ["
                                        "{\"name\": \"s1\", "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []},"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]},"
                                        "{\"name\": \"s2\", "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k1\", \"value\": 123, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []},"
@@ -215,6 +235,9 @@ struct {
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k1\", \"value\": 123, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []}"
@@ -236,7 +259,12 @@ struct {
                                        "{\"name\": \"m2\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "]}"
                "]" },
        { { sdb_store_ge_matcher, SDB_FIELD_LAST_UPDATE,
@@ -259,11 +287,19 @@ struct {
                                "\"services\": ["
                                        "{\"name\": \"s1\", "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []},"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]},"
                                        "{\"name\": \"s2\", "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k1\", \"value\": 123, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []},"
@@ -298,6 +334,9 @@ struct {
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k1\", \"value\": 123, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []}"
@@ -319,6 +358,9 @@ struct {
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                "\"update_interval\": \"0s\", \"backends\": [], "
                                                "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []},"
                                                        "{\"name\": \"k3\", \"value\": 42, "
                                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                                                "\"update_interval\": \"0s\", \"backends\": []}"
@@ -326,7 +368,12 @@ struct {
                                        "{\"name\": \"m2\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "]},"
                        "{\"name\": \"h2\", \"last_update\": \"1970-01-01 00:00:00 +0000\", "
                                "\"update_interval\": \"0s\", \"backends\": [], "
@@ -334,7 +381,12 @@ struct {
                                        "{\"name\": \"m1\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h2\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "]}"
                "]" },
        { { NULL, 0, SDB_DATA_INIT },
@@ -371,7 +423,12 @@ struct {
                                        "{\"name\": \"m2\", "
                                                "\"timeseries\": false, "
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
-                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "\"update_interval\": \"0s\", \"backends\": [], "
+                                               "\"attributes\": ["
+                                                       "{\"name\": \"hostname\", \"value\": \"h1\", "
+                                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", "
+                                                               "\"update_interval\": \"0s\", \"backends\": []}"
+                                               "]}"
                                "]}"
                "]" },
        { { sdb_store_lt_matcher, SDB_FIELD_LAST_UPDATE,
index 3e43c0a64290e6c5d789dd0fbeb1736e8befc10c..7e15502096a04ed83358c1fb41f5aab8e14c098a 100644 (file)
@@ -91,12 +91,19 @@ populate(void)
                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
                                "\"update_interval\": \"0s\", \"backends\": [], " \
                                "\"attributes\": [" \
+                                       "{\"name\": \"hostname\", \"value\": \"h1\", " \
+                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
+                                               "\"update_interval\": \"0s\", \"backends\": []}," \
                                        "{\"name\": \"k3\", \"value\": 42, " \
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
                                                "\"update_interval\": \"0s\", \"backends\": []}]}," \
                        "{\"name\": \"m2\", \"timeseries\": false, " \
                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
-                               "\"update_interval\": \"0s\", \"backends\": []}]}"
+                               "\"update_interval\": \"0s\", \"backends\": [], " \
+                               "\"attributes\": [" \
+                                       "{\"name\": \"hostname\", \"value\": \"h1\", " \
+                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
+                                               "\"update_interval\": \"0s\", \"backends\": []}]}]}"
 #define HOST_H1_ARRAY "["HOST_H1"]"
 #define HOST_H1_LISTING \
        "{\"name\": \"h1\", \"last_update\": \"1970-01-01 00:00:00 +0000\", " \
@@ -110,7 +117,11 @@ populate(void)
                        "\"update_interval\": \"0s\", \"backends\": [], " \
                "\"services\": [" \
                        "{\"name\": \"s1\", \"last_update\": \"1970-01-01 00:00:00 +0000\", " \
-                               "\"update_interval\": \"0s\", \"backends\": []}]}"
+                               "\"update_interval\": \"0s\", \"backends\": [], " \
+                               "\"attributes\": [" \
+                                       "{\"name\": \"hostname\", \"value\": \"h2\", " \
+                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
+                                               "\"update_interval\": \"0s\", \"backends\": []}]}]}"
 #define SERVICE_H2_S1_ARRAY "["SERVICE_H2_S1"]"
 #define SERVICE_H2_S12_LISTING \
        "[{\"name\": \"h2\", \"last_update\": \"1970-01-01 00:00:00 +0000\", " \
@@ -129,6 +140,9 @@ populate(void)
                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
                                "\"update_interval\": \"0s\", \"backends\": [], " \
                                "\"attributes\": [" \
+                                       "{\"name\": \"hostname\", \"value\": \"h1\", " \
+                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
+                                               "\"update_interval\": \"0s\", \"backends\": []}," \
                                        "{\"name\": \"k3\", \"value\": 42, " \
                                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
                                                "\"update_interval\": \"0s\", \"backends\": []}]}]}"
@@ -139,7 +153,11 @@ populate(void)
                "\"metrics\": [" \
                        "{\"name\": \"m1\", \"timeseries\": false, " \
                                "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
-                               "\"update_interval\": \"0s\", \"backends\": []}]}]"
+                               "\"update_interval\": \"0s\", \"backends\": [], " \
+                               "\"attributes\": [" \
+                                       "{\"name\": \"hostname\", \"value\": \"h2\", " \
+                                               "\"last_update\": \"1970-01-01 00:00:00 +0000\", " \
+                                               "\"update_interval\": \"0s\", \"backends\": []}]}]}]"
 #define METRIC_H12_M12_LISTING \
        "[{\"name\": \"h1\", \"last_update\": \"1970-01-01 00:00:00 +0000\", " \
                        "\"update_interval\": \"0s\", \"backends\": [], " \
@@ -294,19 +312,19 @@ static struct {
        },
        {
                "FETCH host 'h1'",
-               0, SDB_CONNECTION_DATA, 851, SDB_CONNECTION_FETCH, HOST_H1,
+               0, SDB_CONNECTION_DATA, 1110, SDB_CONNECTION_FETCH, HOST_H1,
        },
        {
                "LOOKUP hosts MATCHING name = 'h1'",
-               0, SDB_CONNECTION_DATA, 853, SDB_CONNECTION_LOOKUP, HOST_H1_ARRAY,
+               0, SDB_CONNECTION_DATA, 1112, SDB_CONNECTION_LOOKUP, HOST_H1_ARRAY,
        },
        {
                "FETCH host 'h1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 851, SDB_CONNECTION_FETCH, HOST_H1,
+               0, SDB_CONNECTION_DATA, 1110, SDB_CONNECTION_FETCH, HOST_H1,
        },
        {
                "LOOKUP hosts MATCHING name = 'h1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 853, SDB_CONNECTION_LOOKUP, HOST_H1_ARRAY,
+               0, SDB_CONNECTION_DATA, 1112, SDB_CONNECTION_LOOKUP, HOST_H1_ARRAY,
        },
        {
                "FETCH host 'h1' FILTER age < 0s", /* never matches */
@@ -347,19 +365,19 @@ static struct {
        },
        {
                "FETCH service 'h2'.'s1'",
-               0, SDB_CONNECTION_DATA, 218, SDB_CONNECTION_FETCH, SERVICE_H2_S1,
+               0, SDB_CONNECTION_DATA, 356, SDB_CONNECTION_FETCH, SERVICE_H2_S1,
        },
        {
                "LOOKUP services MATCHING name = 's1'",
-               0, SDB_CONNECTION_DATA, 220, SDB_CONNECTION_LOOKUP, SERVICE_H2_S1_ARRAY,
+               0, SDB_CONNECTION_DATA, 358, SDB_CONNECTION_LOOKUP, SERVICE_H2_S1_ARRAY,
        },
        {
                "FETCH service 'h2'.'s1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 218, SDB_CONNECTION_FETCH, SERVICE_H2_S1,
+               0, SDB_CONNECTION_DATA, 356, SDB_CONNECTION_FETCH, SERVICE_H2_S1,
        },
        {
                "LOOKUP services MATCHING name = 's1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 220, SDB_CONNECTION_LOOKUP, SERVICE_H2_S1_ARRAY,
+               0, SDB_CONNECTION_DATA, 358, SDB_CONNECTION_LOOKUP, SERVICE_H2_S1_ARRAY,
        },
        {
                "FETCH service 'h2'.'s1' FILTER age < 0s", /* never matches */
@@ -404,19 +422,19 @@ static struct {
        },
        {
                "FETCH metric 'h1'.'m1'",
-               0, SDB_CONNECTION_DATA, 368, SDB_CONNECTION_FETCH, METRIC_H1_M1,
+               0, SDB_CONNECTION_DATA, 489, SDB_CONNECTION_FETCH, METRIC_H1_M1,
        },
        {
                "LOOKUP metrics MATCHING name = 'm1'",
-               0, SDB_CONNECTION_DATA, 605, SDB_CONNECTION_LOOKUP, METRIC_H12_M1_ARRAY,
+               0, SDB_CONNECTION_DATA, 864, SDB_CONNECTION_LOOKUP, METRIC_H12_M1_ARRAY,
        },
        {
                "FETCH metric 'h1'.'m1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 368, SDB_CONNECTION_FETCH, METRIC_H1_M1,
+               0, SDB_CONNECTION_DATA, 489, SDB_CONNECTION_FETCH, METRIC_H1_M1,
        },
        {
                "LOOKUP metrics MATCHING name = 'm1' FILTER age >= 0s", /* always matches */
-               0, SDB_CONNECTION_DATA, 605, SDB_CONNECTION_LOOKUP, METRIC_H12_M1_ARRAY,
+               0, SDB_CONNECTION_DATA, 864, SDB_CONNECTION_LOOKUP, METRIC_H12_M1_ARRAY,
        },
        {
                "FETCH metric 'h1'.'m1' FILTER age < 0s", /* never matches */