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/1952'
[collectd.git]
/
src
/
ceph.c
diff --git
a/src/ceph.c
b/src/ceph.c
index
458112a
..
7c5c8a5
100644
(file)
--- a/
src/ceph.c
+++ b/
src/ceph.c
@@
-297,6
+297,11
@@
ceph_cb_number(void *ctx, const char *number_val, yajl_len_t number_len)
{
latency_type = 1;
{
latency_type = 1;
+ /* depth >= 2 => (stack[-1] != NULL && stack[-2] != NULL) */
+ assert ((state->depth < 2)
+ || ((state->stack[state->depth - 1] != NULL)
+ && (state->stack[state->depth - 2] != NULL)));
+
/* Super-special case for filestore.journal_wr_bytes.avgcount: For
* some reason, Ceph schema encodes this as a count/sum pair while all
* other "Bytes" data (excluding used/capacity bytes for OSD space) uses
/* Super-special case for filestore.journal_wr_bytes.avgcount: For
* some reason, Ceph schema encodes this as a count/sum pair while all
* other "Bytes" data (excluding used/capacity bytes for OSD space) uses
@@
-1157,7
+1162,6
@@
cconn_process_data(struct cconn *io, yajl_struct *yajl, yajl_handle hand)
}
vtmp->vlist = (value_list_t)VALUE_LIST_INIT;
}
vtmp->vlist = (value_list_t)VALUE_LIST_INIT;
- sstrncpy(vtmp->vlist.host, hostname_g, sizeof(vtmp->vlist.host));
sstrncpy(vtmp->vlist.plugin, "ceph", sizeof(vtmp->vlist.plugin));
sstrncpy(vtmp->vlist.plugin_instance, io->d->name, sizeof(vtmp->vlist.plugin_instance));
sstrncpy(vtmp->vlist.plugin, "ceph", sizeof(vtmp->vlist.plugin));
sstrncpy(vtmp->vlist.plugin_instance, io->d->name, sizeof(vtmp->vlist.plugin_instance));
@@
-1463,15
+1467,22
@@
static int cconn_main_loop(uint32_t request_type)
struct timeval end_tv;
struct cconn io_array[g_num_daemons];
struct timeval end_tv;
struct cconn io_array[g_num_daemons];
- DEBUG("ceph plugin: entering cconn_main_loop(request_type = %d)", request_type);
+ DEBUG ("ceph plugin: entering cconn_main_loop(request_type = %"PRIu32")", request_type);
+
+ if (g_num_daemons < 1)
+ {
+ ERROR ("ceph plugin: No daemons configured. See the \"Daemon\" config option.");
+ return ENOENT;
+ }
/* create cconn array */
/* create cconn array */
- memset(io_array, 0, sizeof(io_array));
- for(size_t i = 0; i < g_num_daemons; ++i)
+ for (size_t i = 0; i < g_num_daemons; i++)
{
{
- io_array[i].d = g_daemons[i];
- io_array[i].request_type = request_type;
- io_array[i].state = CSTATE_UNCONNECTED;
+ io_array[i] = (struct cconn) {
+ .d = g_daemons[i],
+ .request_type = request_type,
+ .state = CSTATE_UNCONNECTED,
+ };
}
/** Calculate the time at which we should give up */
}
/** Calculate the time at which we should give up */