X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpinba.c;h=97eeb0d6bea50d710458e5a69f2dc7efb0ccebee;hb=76fb10bf790e35dd6caca13c4bb5d0f86c517370;hp=227e9dc7ebb59f20a9a5fe0e30ce0ed93fd715e8;hpb=79963d13c1884d1d92667cc502ad20758b084a12;p=collectd.git diff --git a/src/pinba.c b/src/pinba.c index 227e9dc7..97eeb0d6 100644 --- a/src/pinba.c +++ b/src/pinba.c @@ -591,7 +591,7 @@ static int plugin_init(void) /* {{{ */ status = plugin_thread_create(&collector_thread_id, /* attrs = */ NULL, collector_thread, - /* args = */ NULL); + /* args = */ NULL, "pinba collector"); if (status != 0) { char errbuf[1024]; ERROR("pinba plugin: pthread_create(3) failed: %s", @@ -627,38 +627,38 @@ static int plugin_shutdown(void) /* {{{ */ static int plugin_submit(const pinba_statnode_t *res) /* {{{ */ { - value_t value; value_list_t vl = VALUE_LIST_INIT; - vl.values = &value; vl.values_len = 1; - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, "pinba", sizeof(vl.plugin)); sstrncpy(vl.plugin_instance, res->name, sizeof(vl.plugin_instance)); - value.derive = res->req_count; + vl.values = &(value_t){.derive = res->req_count}; sstrncpy(vl.type, "total_requests", sizeof(vl.type)); plugin_dispatch_values(&vl); - value.derive = float_counter_get(&res->req_time, /* factor = */ 1000); + vl.values = &(value_t){ + .derive = float_counter_get(&res->req_time, /* factor = */ 1000)}; sstrncpy(vl.type, "total_time_in_ms", sizeof(vl.type)); plugin_dispatch_values(&vl); - value.derive = res->doc_size; + vl.values = &(value_t){.derive = res->doc_size}; sstrncpy(vl.type, "total_bytes", sizeof(vl.type)); plugin_dispatch_values(&vl); - value.derive = float_counter_get(&res->ru_utime, /* factor = */ 100); + vl.values = &(value_t){ + .derive = float_counter_get(&res->ru_utime, /* factor = */ 100)}; sstrncpy(vl.type, "cpu", sizeof(vl.type)); sstrncpy(vl.type_instance, "user", sizeof(vl.type_instance)); plugin_dispatch_values(&vl); - value.derive = float_counter_get(&res->ru_stime, /* factor = */ 100); + vl.values = &(value_t){ + .derive = float_counter_get(&res->ru_stime, /* factor = */ 100)}; sstrncpy(vl.type, "cpu", sizeof(vl.type)); sstrncpy(vl.type_instance, "system", sizeof(vl.type_instance)); plugin_dispatch_values(&vl); - value.gauge = res->mem_peak; + vl.values = &(value_t){.gauge = res->mem_peak}; sstrncpy(vl.type, "memory", sizeof(vl.type)); sstrncpy(vl.type_instance, "peak", sizeof(vl.type_instance)); plugin_dispatch_values(&vl); @@ -685,5 +685,3 @@ void module_register(void) /* {{{ */ plugin_register_read("pinba", plugin_read); plugin_register_shutdown("pinba", plugin_shutdown); } /* }}} void module_register */ - -/* vim: set sw=2 sts=2 et fdm=marker : */