What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
Rather than leaving stale connections about we tried to poll for data coming in
from InfluxDB and timeout if it didn't repond in a timely manner. This introduced
a race where the timeout triggers, a context switch occurs where data is actually
available and the TlsStream spins trying to asynchronously notify that data is
available, but which never gets read. Not only does this use up 100% of a core,
but it also slowly starves the system of handler threads at which point metrics
stop being delivered.
This basically removes the poll and timeout, any TLS socket erros should be
detected by TCP keep-alives.
Fixes#5460#5469
On a non 204 response we parse the HTTP response until complete e.g. do the headers
and body, not just the header. A new interface is added to the response to allow us
to determine the body size so that it may be read out and buffered. The body is
parsed and any error message printed out. In the event that the parsing fails the
raw body is dumped out; better than nothing!
fixes#4411
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
Exposes the TCP socket used to communicate with the InfluxDB server. When we are
expecing a response we can now call poll() on the socket to wait for data to become
available. If it doesn't in a user configurable timeout period we abort the request.
fixes#4927fixes#4941
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
Previously the logic would just bail out if no performance data was associated with a
check, the problem being that check metadata was skipped too. This rearranges the code
to dump out performance metrics if they exist, then dump out metadata if requested. This
also fixes an issue whereby metadata was being sent for every performance data in the
check result, rather than just once, so we save a bit of bandwidth as a result.
fixes#12276
Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>