projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'github/pr/2398'
[collectd.git]
/
src
/
write_mongodb.c
diff --git
a/src/write_mongodb.c
b/src/write_mongodb.c
index
e90900e
..
46b6d86
100644
(file)
--- a/
src/write_mongodb.c
+++ b/
src/write_mongodb.c
@@
-93,10
+93,10
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
BSON_APPEND_UTF8(ret, "type_instance", vl->type_instance);
BSON_APPEND_ARRAY_BEGIN(ret, "values", &subarray); /* {{{ */
BSON_APPEND_UTF8(ret, "type_instance", vl->type_instance);
BSON_APPEND_ARRAY_BEGIN(ret, "values", &subarray); /* {{{ */
- for (
in
t i = 0; i < ds->ds_num; i++) {
+ for (
size_
t i = 0; i < ds->ds_num; i++) {
char key[16];
char key[16];
- s
snprintf(key, sizeof(key), "%i
", i);
+ s
nprintf(key, sizeof(key), "%zu
", i);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
@@
-109,7
+109,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
BSON_APPEND_INT64(&subarray, key, vl->values[i].absolute);
else {
else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
BSON_APPEND_INT64(&subarray, key, vl->values[i].absolute);
else {
- ERROR("write_mongodb plugin: Unknown ds_type %d for index %
d
",
+ ERROR("write_mongodb plugin: Unknown ds_type %d for index %
zu
",
ds->ds[i].type, i);
bson_destroy(ret);
return NULL;
ds->ds[i].type, i);
bson_destroy(ret);
return NULL;
@@
-118,10
+118,10
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
bson_append_array_end(ret, &subarray); /* }}} values */
BSON_APPEND_ARRAY_BEGIN(ret, "dstypes", &subarray); /* {{{ */
bson_append_array_end(ret, &subarray); /* }}} values */
BSON_APPEND_ARRAY_BEGIN(ret, "dstypes", &subarray); /* {{{ */
- for (
in
t i = 0; i < ds->ds_num; i++) {
+ for (
size_
t i = 0; i < ds->ds_num; i++) {
char key[16];
char key[16];
- s
snprintf(key, sizeof(key), "%i
", i);
+ s
nprintf(key, sizeof(key), "%zu
", i);
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
@@
-131,10
+131,10
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
bson_append_array_end(ret, &subarray); /* }}} dstypes */
BSON_APPEND_ARRAY_BEGIN(ret, "dsnames", &subarray); /* {{{ */
bson_append_array_end(ret, &subarray); /* }}} dstypes */
BSON_APPEND_ARRAY_BEGIN(ret, "dsnames", &subarray); /* {{{ */
- for (
in
t i = 0; i < ds->ds_num; i++) {
+ for (
size_
t i = 0; i < ds->ds_num; i++) {
char key[16];
char key[16];
- s
snprintf(key, sizeof(key), "%i
", i);
+ s
nprintf(key, sizeof(key), "%zu
", i);
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */
@@
-366,9
+366,9
@@
static int wm_config_node(oconfig_item_t *ci) /* {{{ */
}
if (status == 0) {
}
if (status == 0) {
- char cb_name[DATA_MAX_NAME_LEN];
+ char cb_name[
sizeof("write_mongodb/") +
DATA_MAX_NAME_LEN];
- s
s
nprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
+ snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
status =
plugin_register_write(cb_name, wm_write,
status =
plugin_register_write(cb_name, wm_write,