Closed ramosbugs closed 3 years ago
Currently, send_batch creates a new reqwest client for each batch, which results in creating a new HTTPS connection for each batch. This PR reuses the same reqwest client across batches, which reduces latency by reusing connections.
send_batch
This pattern is consistent with the reqwest docs:
The Client holds a connection pool internally, so it is advised that you create one and reuse it.
This PR also adds some trace-level logging, which should have no effect unless trace logs are explicitly enabled for the log crate.
trace
log
Thank you @ramosbugs!
Currently,
send_batch
creates a new reqwest client for each batch, which results in creating a new HTTPS connection for each batch. This PR reuses the same reqwest client across batches, which reduces latency by reusing connections.This pattern is consistent with the reqwest docs:
This PR also adds some
trace
-level logging, which should have no effect unless trace logs are explicitly enabled for thelog
crate.