index 113d3a0010d0f5669e53d68aa6dbd2fdad753858..6be3c144e37f3cc2466f1ffa840a408c4e12a0ce 100644 (file)
# include "config.h"
#endif
+#include "core/plugin.h"
#include "core/store.h"
#include "testutils.h"
{
sdb_data_t datum;
- sdb_store_host("h1", 1 * SDB_INTERVAL_SECOND);
- sdb_store_host("h2", 3 * SDB_INTERVAL_SECOND);
+ sdb_store_init();
+
+ sdb_plugin_store_host("h1", 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_host("h2", 3 * SDB_INTERVAL_SECOND);
datum.type = SDB_TYPE_STRING;
datum.data.string = "v1";
- sdb_store_attribute("h1", "k1", &datum, 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_attribute("h1", "k1", &datum, 1 * SDB_INTERVAL_SECOND);
datum.data.string = "v2";
- sdb_store_attribute("h1", "k2", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_attribute("h1", "k2", &datum, 2 * SDB_INTERVAL_SECOND);
datum.data.string = "v3";
- sdb_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND);
/* make sure that older updates don't overwrite existing values */
datum.data.string = "fail";
- sdb_store_attribute("h1", "k2", &datum, 1 * SDB_INTERVAL_SECOND);
- sdb_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_attribute("h1", "k2", &datum, 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_attribute("h1", "k3", &datum, 2 * SDB_INTERVAL_SECOND);
- sdb_store_metric("h1", "m1", /* store */ NULL, 2 * SDB_INTERVAL_SECOND);
- sdb_store_metric("h1", "m2", /* store */ NULL, 1 * SDB_INTERVAL_SECOND);
- sdb_store_metric("h2", "m1", /* store */ NULL, 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_metric("h1", "m1", /* store */ NULL, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_metric("h1", "m2", /* store */ NULL, 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_metric("h2", "m1", /* store */ NULL, 1 * SDB_INTERVAL_SECOND);
- sdb_store_service("h2", "s1", 1 * SDB_INTERVAL_SECOND);
- sdb_store_service("h2", "s2", 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_service("h2", "s1", 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_service("h2", "s2", 2 * SDB_INTERVAL_SECOND);
datum.type = SDB_TYPE_INTEGER;
datum.data.integer = 42;
- sdb_store_metric_attr("h1", "m1", "k3", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_metric_attribute("h1", "m1", "k3",
+ &datum, 2 * SDB_INTERVAL_SECOND);
datum.data.integer = 123;
- sdb_store_service_attr("h2", "s2", "k1", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_service_attribute("h2", "s2", "k1",
+ &datum, 2 * SDB_INTERVAL_SECOND);
datum.data.integer = 4711;
- sdb_store_service_attr("h2", "s2", "k2", &datum, 1 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_service_attribute("h2", "s2", "k2",
+ &datum, 1 * SDB_INTERVAL_SECOND);
/* don't overwrite k1 */
datum.data.integer = 666;
- sdb_store_service_attr("h2", "s2", "k1", &datum, 2 * SDB_INTERVAL_SECOND);
+ sdb_plugin_store_service_attribute("h2", "s2", "k1",
+ &datum, 2 * SDB_INTERVAL_SECOND);
} /* populate */
static int
verify_json_output(buf, store_tojson_data[_i].expected);
- free(f);
sdb_object_deref(SDB_OBJ(filter));
+ sdb_object_deref(SDB_OBJ(f));
sdb_strbuf_destroy(buf);
}
END_TEST