(cobra bots) add a --heartbeat_timeout option to specify when the bot should terminate because no events are received

This commit is contained in:
Benjamin Sergeant
2020-05-06 22:01:48 -07:00
parent c030a62c8b
commit 0772ef7ef5
15 changed files with 58 additions and 14 deletions

View File

@ -142,6 +142,7 @@ TEST_CASE("Cobra_to_sentry_bot", "[cobra_bots]")
std::string position("$");
bool verbose = true;
bool enableHeartbeat = false;
int heartBeatTimeout = 60;
// FIXME: try to get this working with https instead of http
// to regress the TLS 1.3 OpenSSL bug
@ -159,8 +160,15 @@ TEST_CASE("Cobra_to_sentry_bot", "[cobra_bots]")
// Only run the bot for 3 seconds
int runtime = 3;
int64_t sentCount = cobra_to_sentry_bot(
config, channel, filter, position, sentryClient, verbose, enableHeartbeat, runtime);
int64_t sentCount = cobra_to_sentry_bot(config,
channel,
filter,
position,
sentryClient,
verbose,
enableHeartbeat,
heartBeatTimeout,
runtime);
//
// We want at least 2 messages to be sent
//

View File

@ -91,6 +91,7 @@ TEST_CASE("Cobra_to_statsd_bot", "[cobra_bots]")
std::string position("$");
bool verbose = true;
bool enableHeartbeat = false;
int heartBeatTimeout = 60;
// Only run the bot for 3 seconds
int runtime = 3;
@ -123,6 +124,7 @@ TEST_CASE("Cobra_to_statsd_bot", "[cobra_bots]")
timer,
verbose,
enableHeartbeat,
heartBeatTimeout,
runtime);
//
// We want at least 2 messages to be sent

View File

@ -89,6 +89,7 @@ TEST_CASE("Cobra_to_stdout_bot", "[cobra_bots]")
std::string position("$");
bool quiet = false;
bool enableHeartbeat = false;
int heartBeatTimeout = 60;
// Only run the bot for 3 seconds
int runtime = 3;
@ -96,8 +97,15 @@ TEST_CASE("Cobra_to_stdout_bot", "[cobra_bots]")
// We could try to capture the output ... not sure how.
bool fluentd = true;
int64_t sentCount = ix::cobra_to_stdout_bot(
config, channel, filter, position, fluentd, quiet, enableHeartbeat, runtime);
int64_t sentCount = ix::cobra_to_stdout_bot(config,
channel,
filter,
position,
fluentd,
quiet,
enableHeartbeat,
heartBeatTimeout,
runtime);
//
// We want at least 2 messages to be sent
//