From 6f270819121afb743d783f9a72786e367d1048a3 Mon Sep 17 00:00:00 2001 From: Vladimir Kobal Date: Thu, 12 Dec 2019 21:41:11 +0200 Subject: Implement the main flow for the Exporting Engine (#7149) * Add top level tests * Add a skeleton for preparing buffers * Initialize graphite instance * Prepare buffers for all instances * Add Grafite collected value formatter * Add support for exporting.conf read and parsing * - Use new exporting_config instead of netdata_config * Implement Grafite worker * Disable exporting engine compilation if libuv is not available * Add mutex locks - Configure connectors as connector_ in sections of exporting.conf - Change exporting_select_type to check for connector_ fields * - Override exporting_config structure if there no exporting.conf so that look ups don't fail and we maintain backwards compatibility * Separate fixtures in unit tests * Test exporting_discard_responce * Test response receiving * Test buffer sending * Test simple connector worker - Instance section has the format connector:instance_name e.g graphite:my_graphite_instance - Connectors with : in their name e.g graphite:plaintext are reserved So graphite:plaintext is not accepted because it would activate an instance with name "plaintext" It should be graphite:plaintext:instance_name * - Enable the add_connector_instance to cleanup the internal structure by passing NULL,not NULL arguments * Implement configurable update interval - Add additional check to verify instance uniqueness across connectors * Add host and chart filters * Add the value calculation over a database series * Add the calculated over stored data graphite connector * Add tests for graphite connector * Add JSON connector * Add tests for JSON formatting functions * Add OpenTSDB connector * Add tests for the OpenTSDB connector * Add temporaty notes to the documentation --- database/rrd.h | 2 ++ database/rrdhost.c | 2 ++ database/rrdset.c | 2 ++ 3 files changed, 6 insertions(+) (limited to 'database') diff --git a/database/rrd.h b/database/rrd.h index 8efe2adb05..c75b0deebe 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -408,6 +408,7 @@ struct rrdset { // it goes around in a round-robin fashion RRDSET_FLAGS flags; // configuration flags + RRDSET_FLAGS *exporting_flags; // array of flags for exporting connector instances int gap_when_lost_iterations_above; // after how many lost iterations a gap should be stored // netdata will interpolate values for gaps lower than this @@ -627,6 +628,7 @@ struct rrdhost { const char *timezone; // the timezone of the host RRDHOST_FLAGS flags; // flags about this RRDHOST + RRDHOST_FLAGS *exporting_flags; // array of flags for exporting connector instances int rrd_update_every; // the update frequency of the host long rrd_history_entries; // the number of history entries for the host's charts diff --git a/database/rrdhost.c b/database/rrdhost.c index bf540a2097..737e066c9d 100644 --- a/database/rrdhost.c +++ b/database/rrdhost.c @@ -597,6 +597,8 @@ void rrdhost_free(RRDHOST *host) { while(host->rrdset_root) rrdset_free(host->rrdset_root); + freez(host->exporting_flags); + while(host->alarms) rrdcalc_unlink_and_free(host, host->alarms); diff --git a/database/rrdset.c b/database/rrdset.c index 0f52970304..1939d72a9c 100644 --- a/database/rrdset.c +++ b/database/rrdset.c @@ -328,6 +328,8 @@ void rrdset_free(RRDSET *st) { // ------------------------------------------------------------------------ // free its children structures + freez(st->exporting_flags); + while(st->variables) rrdsetvar_free(st->variables); while(st->alarms) rrdsetcalc_unlink(st->alarms); while(st->dimensions) rrddim_free(st, st->dimensions); -- cgit v1.2.3