From 500eabf6dddaf181b062a37a3d0a745ca098d7b5 Mon Sep 17 00:00:00 2001 From: Lukas Joswiak Date: Wed, 13 Jan 2021 17:20:09 -0800 Subject: [PATCH] Add network option to set tracer in fdbclient --- fdbclient/NativeAPI.actor.cpp | 17 +++++++++++++++++ fdbclient/vexillographer/fdb.options | 3 +++ 2 files changed, 20 insertions(+) diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index eed3960458..ea755b1bff 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -1541,6 +1541,23 @@ void setNetworkOption(FDBNetworkOptions::Option option, Optional valu validateOptionValue(value, false); networkOptions.runLoopProfilingEnabled = true; break; + case FDBNetworkOptions::CLIENT_TRACER: { + validateOptionValue(value, true); + std::string tracer = value.get().toString(); + if (tracer == "none" || tracer == "disabled") { + openTracer(TracerType::DISABLED); + } else if (tracer == "logfile" || tracer == "file" || tracer == "log_file") { + openTracer(TracerType::LOG_FILE); + } else if (tracer == "network_async") { + openTracer(TracerType::NETWORK_ASYNC); + } else if (tracer == "network_lossy") { + openTracer(TracerType::NETWORK_LOSSY); + } else { + fprintf(stderr, "ERROR: Unknown or unsupported tracer: `%s'", tracer.c_str()); + throw invalid_option_value(); + } + break; + } default: break; } diff --git a/fdbclient/vexillographer/fdb.options b/fdbclient/vexillographer/fdb.options index 2abad7f368..66421b8c06 100644 --- a/fdbclient/vexillographer/fdb.options +++ b/fdbclient/vexillographer/fdb.options @@ -125,6 +125,9 @@ description is not currently required but encouraged.