```
"src/daemon/plugin.c", line 439: warning: assignment type mismatch:
pointer to function(void) returning void "=" pointer to void
"src/daemon/plugin.c", line 533: warning: assignment type mismatch:
pointer to function(void) returning int "=" pointer to void
"src/daemon/plugin.c", line 540: warning: assignment type mismatch:
pointer to function(pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 1716: warning: assignment type mismatch:
pointer to function(void) returning int "=" pointer to void
"src/daemon/plugin.c", line 1784: warning: assignment type mismatch:
pointer to function(void) returning int "=" pointer to void
"src/daemon/plugin.c", line 1789: warning: assignment type mismatch:
pointer to function(pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 1835: warning: assignment type mismatch:
pointer to function(pointer to const struct metric_family_s {pointer to char name, pointer to char help, enum {METRIC_TYPE_UNTYPED(2), METRIC_TYPE_GAUGE(1), METRIC_TYPE_COUNTER(0)} type, struct {..} metric}, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 1872: warning: assignment type mismatch:
pointer to function(pointer to const struct metric_family_s {pointer to char name, pointer to char help, enum {METRIC_TYPE_UNTYPED(2), METRIC_TYPE_GAUGE(1), METRIC_TYPE_COUNTER(0)} type, struct {..} metric}, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 1899: warning: assignment type mismatch:
pointer to function(unsigned long long, pointer to const char, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 1944: warning: assignment type mismatch:
pointer to function(void) returning int "=" pointer to void
"src/daemon/plugin.c", line 1986: warning: assignment type mismatch:
pointer to function(pointer to const struct metric_family_s {pointer to char name, pointer to char help, enum {METRIC_TYPE_UNTYPED(2), METRIC_TYPE_GAUGE(1), METRIC_TYPE_COUNTER(0)} type, struct {..} metric}, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 2342: warning: assignment type mismatch:
pointer to function(pointer to const struct notification_s {int severity, unsigned long long time, array[256] of char message, array[128] of char host, array[128] of char plugin, array[128] of char plugin_instance, array[128] of char type, array[128] of char type_instance, pointer to struct notification_meta_s {..} meta}, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning int "=" pointer to void
"src/daemon/plugin.c", line 2382: warning: assignment type mismatch:
pointer to function(int, pointer to const char, pointer to struct user_data_s {pointer to void data, pointer to function(..) returning void free_func}) returning void "=" pointer to void
```
format_json, format_kairosdb: Don't enable beatification of JSON.
The code depends on the last character in the buffer being ']'. If
"beautification" is enabled, it will add a newline at the end, which
breaks the "append" mechanic.
format_json: Add support for appending metric_family_t's to the buffer.
With this change, multiple metric_family_t's can be added to a buffer
sequentially. The implementation that did not use libyajl has been
removed because it was unused (it only implemented marshalling of
value_list_t).
format_stackdriver: Check for counter reset in format_time_series().
Previously, this check was done in format_typed_value() when the time
series data was already partially written to the buffer. Doing the check
there would result in invalid JSON output.
Additionally, the comparison was the wrong way around, causing the
assertion to fail for all counter metrics.
common: Create the metric_family_t and metric_t types.
A "metric family" is a set of metrics, all with the same name (but
different labels and/or label values). The identity is split between the
two types: the "metric family" holds the "name" while the "metric" holds
the labels. Likewise, the "metric family" holds the metric type, the
"metric" holds the metric value.
This commit contains all required changes to compile the daemon, but
pretty much everything else still fails to build. The tests have not yet
updated either.
The "cpu plugin" has been updated as a proof-of-concept implementation.
* Struct "metric_t": unnecessary fields "type", "plugin", "ds" have
been removed. The field "value_ds_type" has been renamed to
"value_type".
* The reference counted, multiple instance "meta_data_list_head_t" type
has been removed. Manually doing the reference counting all over the
place is error prone and it seems like premature optimization.
* The "<type>_destroy" functions must handle NULL gracefully. Removed
NULL-checks around their invocation to improve readability.
* Struct "metric_t": unnecessary fields "type", "plugin", "ds" have
been removed. The field "value_ds_type" has been renamed to
"value_type".
* The reference counted, multiple instance "meta_data_list_head_t" type
has been removed. Manually doing the reference counting all over the
place is error prone and it seems like premature optimization.
* The "<type>_destroy" functions must handle NULL gracefully. Removed
NULL-checks around their invocation to improve readability.
* Struct "metric_t": unnecessary fields "type", "plugin", "ds" have
been removed. The field "value_ds_type" has been renamed to
"value_type".
* The reference counted, multiple instance "meta_data_list_head_t" type
has been removed. Manually doing the reference counting all over the
place is error prone and it seems like premature optimization.
* The "<type>_destroy" functions must handle NULL gracefully. Removed
NULL-checks around their invocation to improve readability.
* Struct "metric_t": unnecessary fields "type", "plugin", "ds" have
been removed. The field "value_ds_type" has been renamed to
"value_type".
* The reference counted, multiple instance "meta_data_list_head_t" type
has been removed. Manually doing the reference counting all over the
place is error prone and it seems like premature optimization.
* The "<type>_destroy" functions must handle NULL gracefully. Removed
NULL-checks around their invocation to improve readability.
* Struct "metric_t": unnecessary fields "type", "plugin", "ds" have
been removed. The field "value_ds_type" has been renamed to
"value_type".
* The reference counted, multiple instance "meta_data_list_head_t" type
has been removed. Manually doing the reference counting all over the
place is error prone and it seems like premature optimization.
* The "<type>_destroy" functions must handle NULL gracefully. Removed
NULL-checks around their invocation to improve readability.
barometer, python plugins: Reworked some code in src/daemon/plugin.[ch].
Unfortunately it's all a bit messy and entangled. Since this is such
an early WIP, I didn't spend the (substantial) time needed to pick this
into separate changes. The changes in this commit are:
* Create a consistent naming schema for the identity functions:
* Rename "create_identity" to "identity_create_legacy".
* Rename "clone_identity" to "identity_clone".
* Rename "destroy_identity" to "identity_destroy".
* Add "identity_create" to allocate a new identity_t.
* Copy key and value strings within "identity_add_label".
* Make use of "identity_create" and "identity_add_label" in
"identity_clone", "identity_create_legacy" and others that used
to fiddle with the AVL tree directly.
* Remove the "_p" suffix used for pointers. This is quite unusual for
the collectd codebase.
cmds: Reworked some code in src/daemon/plugin.[ch].
Unfortunately it's all a bit messy and entangled. Since this is such
an early WIP, I didn't spend the (substantial) time needed to pick this
into separate changes. The changes in this commit are:
* Create a consistent naming schema for the identity functions:
* Rename "create_identity" to "identity_create_legacy".
* Rename "clone_identity" to "identity_clone".
* Rename "destroy_identity" to "identity_destroy".
* Add "identity_create" to allocate a new identity_t.
* Copy key and value strings within "identity_add_label".
* Make use of "identity_create" and "identity_add_label" in
"identity_clone", "identity_create_legacy" and others that used
to fiddle with the AVL tree directly.
* Remove the "_p" suffix used for pointers. This is quite unusual for
the collectd codebase.
This commit is where the major transform takes palce; the internal
representation is changed, and the read plugins use that indirectly
when they submit a value list transparently.
The baromerter read plugin has been converted to using metric_t
representation natively.
The write plugins have to be adapted to use these new single data
source metrics.