projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b247ab
)
write_riemann: do not read responses twice
author
Pierre-Yves Ritschard
<pyr@spootnik.org>
Thu, 14 Apr 2016 08:13:00 +0000
(10:13 +0200)
committer
Pierre-Yves Ritschard
<pyr@spootnik.org>
Thu, 14 Apr 2016 08:15:37 +0000
(10:15 +0200)
src/write_riemann.c
patch
|
blob
|
history
diff --git
a/src/write_riemann.c
b/src/write_riemann.c
index
f836b9d
..
2936dfa
100644
(file)
--- a/
src/write_riemann.c
+++ b/
src/write_riemann.c
@@
-461,30
+461,16
@@
static int wrr_batch_flush_nolock(cdtime_t timeout,
cdtime_t now;
int status = 0;
cdtime_t now;
int status = 0;
+ now = cdtime();
if (timeout > 0) {
if (timeout > 0) {
- now = cdtime();
- if ((host->batch_init + timeout) > now)
+ if ((host->batch_init + timeout) > now) {
return status;
return status;
+ }
}
wrr_send_nolock(host, host->batch_msg);
riemann_message_free(host->batch_msg);
}
wrr_send_nolock(host, host->batch_msg);
riemann_message_free(host->batch_msg);
- if (host->client_type != RIEMANN_CLIENT_UDP)
- {
- riemann_message_t *response;
-
- response = riemann_client_recv_message(host->client);
-
- if (!response)
- {
- wrr_disconnect(host);
- return errno;
- }
-
- riemann_message_free(response);
- }
-
- host->batch_init = cdtime();
+ host->batch_init = now;
host->batch_msg = NULL;
return status;
}
host->batch_msg = NULL;
return status;
}
@@
-611,7
+597,7
@@
static int wrr_write(const data_set_t *ds, /* {{{ */
}
if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
}
if (host->client_type != RIEMANN_CLIENT_UDP && host->batch_mode) {
- wrr_batch_add_value_list(host, ds, vl, statuses);
+
wrr_batch_add_value_list(host, ds, vl, statuses);
} else {
msg = wrr_value_list_to_message(host, ds, vl, statuses);
if (msg == NULL)
} else {
msg = wrr_value_list_to_message(host, ds, vl, statuses);
if (msg == NULL)