Skip to content

Commit

Permalink
Merge branch 'master' into fix-typos
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tclinkenbeard committed Sep 12, 2021
2 parents b08621f + c32c3b6 commit 87ee428
Show file tree
Hide file tree
Showing 23 changed files with 5,160 additions and 4,850 deletions.
1 change: 1 addition & 0 deletions fdbcli/CMakeLists.txt
Expand Up @@ -14,6 +14,7 @@ set(FDBCLI_SRCS
ProfileCommand.actor.cpp
SetClassCommand.actor.cpp
SnapshotCommand.actor.cpp
StatusCommand.actor.cpp
SuspendCommand.actor.cpp
ThrottleCommand.actor.cpp
TriggerDDTeamInfoLogCommand.actor.cpp
Expand Down
20 changes: 9 additions & 11 deletions fdbcli/ProfileCommand.actor.cpp
Expand Up @@ -51,18 +51,16 @@ ACTOR Future<bool> profileCommandActor(Reference<ITransaction> tr, std::vector<S
fprintf(stderr, "ERROR: Addtional arguments to `get` are not supported.\n");
return false;
}
state std::string sampleRateStr = "default";
state std::string sizeLimitStr = "default";
Optional<Value> sampleRateValue =
wait(safeThreadFutureToFuture(tr->get(GlobalConfig::prefixedKey(fdbClientInfoTxnSampleRate))));
if (sampleRateValue.present() &&
!std::isinf(boost::lexical_cast<double>(sampleRateValue.get().toString()))) {
sampleRateStr = sampleRateValue.get().toString();
std::string sampleRateStr = "default";
std::string sizeLimitStr = "default";
const double sampleRateDbl = GlobalConfig::globalConfig().get<double>(
fdbClientInfoTxnSampleRate, std::numeric_limits<double>::infinity());
if (!std::isinf(sampleRateDbl)) {
sampleRateStr = std::to_string(sampleRateDbl);
}
Optional<Value> sizeLimitValue =
wait(safeThreadFutureToFuture(tr->get(GlobalConfig::prefixedKey(fdbClientInfoTxnSizeLimit))));
if (sizeLimitValue.present() && boost::lexical_cast<int64_t>(sizeLimitValue.get().toString()) != -1) {
sizeLimitStr = sizeLimitValue.get().toString();
const int64_t sizeLimit = GlobalConfig::globalConfig().get<int64_t>(fdbClientInfoTxnSizeLimit, -1);
if (sizeLimit != -1) {
sizeLimitStr = boost::lexical_cast<std::string>(sizeLimit);
}
printf("Client profiling rate is set to %s and size limit is set to %s.\n",
sampleRateStr.c_str(),
Expand Down

0 comments on commit 87ee428

Please sign in to comment.