Browse Source

log(InfluxWriter): add msg when recovers from request failure

master
Jonathan Strong 5 years ago
parent
commit
4a28334f4a
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      src/influx.rs

+ 10
- 2
src/influx.rs View File

@@ -431,7 +431,7 @@ impl InfluxWriter {
}
let url = url.clone(); // Arc would be faster, but `hyper::Client::post` consumes url
let tx = http_tx.clone();
let thread_logger = logger.new(o!("thread" => "InfluxWriter:http", "n_outstanding" => n_outstanding));
let thread_logger = logger.new(o!("thread" => "InfluxWriter:http", "n_outstanding" => n_outstanding)); // re `thread_logger` name: disambiguating for `logger` after thread closure
let client = Arc::clone(&client);
debug!(logger, "launching http thread");
let thread_res = thread::Builder::new().name(format!("inflx-http{}", n_outstanding)).spawn(move || {
@@ -462,7 +462,15 @@ impl InfluxWriter {
'b: loop {
n_tx += 1;
match tx.try_send(resp.take().unwrap()) {
Ok(_) => return,
Ok(_) => {
if n_req > 0 {
info!(logger, "successfully recovered from failed request with retry";
"n_req" => n_req,
"n_tx" => n_tx,
"elapsed" => %format_args!("{:?}", Instant::now() - start));
}
return
}

Err(chan::TrySendError::Full(r)) => {
let throttle = Duration::from_millis(1000) * n_tx;


Loading…
Cancel
Save