Add count parameter to LatencyBands::addMeasurement
This commit is contained in:
parent
8d2e018ec4
commit
8766809cee
|
@ -138,6 +138,8 @@ void LatencyBands::insertBand(double value) {
|
||||||
bands.emplace(std::make_pair(value, std::make_unique<Counter>(format("Band%f", value), *cc)));
|
bands.emplace(std::make_pair(value, std::make_unique<Counter>(format("Band%f", value), *cc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FDB_DEFINE_BOOLEAN_PARAM(Filtered);
|
||||||
|
|
||||||
LatencyBands::LatencyBands(std::string const& name,
|
LatencyBands::LatencyBands(std::string const& name,
|
||||||
UID id,
|
UID id,
|
||||||
double loggingInterval,
|
double loggingInterval,
|
||||||
|
@ -158,13 +160,13 @@ void LatencyBands::addThreshold(double value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LatencyBands::addMeasurement(double measurement, bool filtered) {
|
void LatencyBands::addMeasurement(double measurement, int count, Filtered filtered) {
|
||||||
if (filtered && filteredCount) {
|
if (filtered && filteredCount) {
|
||||||
++(*filteredCount);
|
(*filteredCount) += count;
|
||||||
} else if (bands.size() > 0) {
|
} else if (bands.size() > 0) {
|
||||||
auto itr = bands.upper_bound(measurement);
|
auto itr = bands.upper_bound(measurement);
|
||||||
ASSERT(itr != bands.end());
|
ASSERT(itr != bands.end());
|
||||||
++(*itr->second);
|
(*itr->second) += count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,8 @@ static void specialCounter(CounterCollection& collection, std::string const& nam
|
||||||
new SpecialCounter<F>(collection, name, std::move(f));
|
new SpecialCounter<F>(collection, name, std::move(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FDB_DECLARE_BOOLEAN_PARAM(Filtered);
|
||||||
|
|
||||||
class LatencyBands {
|
class LatencyBands {
|
||||||
std::map<double, std::unique_ptr<Counter>> bands;
|
std::map<double, std::unique_ptr<Counter>> bands;
|
||||||
std::unique_ptr<Counter> filteredCount;
|
std::unique_ptr<Counter> filteredCount;
|
||||||
|
@ -203,7 +205,7 @@ public:
|
||||||
double loggingInterval,
|
double loggingInterval,
|
||||||
std::function<void(TraceEvent&)> const& decorator = [](auto&) {});
|
std::function<void(TraceEvent&)> const& decorator = [](auto&) {});
|
||||||
void addThreshold(double value);
|
void addThreshold(double value);
|
||||||
void addMeasurement(double measurement, bool filtered = false);
|
void addMeasurement(double measurement, int count = 1, Filtered = Filtered::False);
|
||||||
void clearBands();
|
void clearBands();
|
||||||
~LatencyBands();
|
~LatencyBands();
|
||||||
};
|
};
|
||||||
|
|
|
@ -1910,7 +1910,7 @@ ACTOR Future<Void> reply(CommitBatchContext* self) {
|
||||||
bool filter = self->maxTransactionBytes >
|
bool filter = self->maxTransactionBytes >
|
||||||
pProxyCommitData->latencyBandConfig.get().commitConfig.maxCommitBytes.orDefault(
|
pProxyCommitData->latencyBandConfig.get().commitConfig.maxCommitBytes.orDefault(
|
||||||
std::numeric_limits<int>::max());
|
std::numeric_limits<int>::max());
|
||||||
pProxyCommitData->stats.commitLatencyBands.addMeasurement(duration, filter);
|
pProxyCommitData->stats.commitLatencyBands.addMeasurement(duration, 1, Filtered(filter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -721,7 +721,7 @@ ACTOR Future<Void> sendGrvReplies(Future<GetReadVersionReply> replyFuture,
|
||||||
reply.proxyId = grvProxyData->dbgid;
|
reply.proxyId = grvProxyData->dbgid;
|
||||||
reply.proxyTagThrottledDuration = request.proxyTagThrottledDuration;
|
reply.proxyTagThrottledDuration = request.proxyTagThrottledDuration;
|
||||||
|
|
||||||
if (!request.tags.empty()) {
|
if (request.isTagged()) {
|
||||||
auto& priorityThrottledTags = clientThrottledTags[request.priority];
|
auto& priorityThrottledTags = clientThrottledTags[request.priority];
|
||||||
for (auto tag : request.tags) {
|
for (auto tag : request.tags) {
|
||||||
auto tagItr = priorityThrottledTags.find(tag.first);
|
auto tagItr = priorityThrottledTags.find(tag.first);
|
||||||
|
|
|
@ -1996,7 +1996,7 @@ ACTOR Future<Void> getValueQ(StorageServer* data, GetValueRequest req) {
|
||||||
if (data->latencyBandConfig.present()) {
|
if (data->latencyBandConfig.present()) {
|
||||||
int maxReadBytes =
|
int maxReadBytes =
|
||||||
data->latencyBandConfig.get().readConfig.maxReadBytes.orDefault(std::numeric_limits<int>::max());
|
data->latencyBandConfig.get().readConfig.maxReadBytes.orDefault(std::numeric_limits<int>::max());
|
||||||
data->counters.readLatencyBands.addMeasurement(duration, resultSize > maxReadBytes);
|
data->counters.readLatencyBands.addMeasurement(duration, 1, Filtered(resultSize > maxReadBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
|
@ -3928,9 +3928,10 @@ ACTOR Future<Void> getKeyValuesQ(StorageServer* data, GetKeyValuesRequest req)
|
||||||
int maxSelectorOffset =
|
int maxSelectorOffset =
|
||||||
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
||||||
data->counters.readLatencyBands.addMeasurement(duration,
|
data->counters.readLatencyBands.addMeasurement(duration,
|
||||||
resultSize > maxReadBytes ||
|
1,
|
||||||
abs(req.begin.offset) > maxSelectorOffset ||
|
Filtered(resultSize > maxReadBytes ||
|
||||||
abs(req.end.offset) > maxSelectorOffset);
|
abs(req.begin.offset) > maxSelectorOffset ||
|
||||||
|
abs(req.end.offset) > maxSelectorOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
|
@ -5007,9 +5008,10 @@ ACTOR Future<Void> getMappedKeyValuesQ(StorageServer* data, GetMappedKeyValuesRe
|
||||||
int maxSelectorOffset =
|
int maxSelectorOffset =
|
||||||
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
||||||
data->counters.readLatencyBands.addMeasurement(duration,
|
data->counters.readLatencyBands.addMeasurement(duration,
|
||||||
resultSize > maxReadBytes ||
|
1,
|
||||||
abs(req.begin.offset) > maxSelectorOffset ||
|
Filtered(resultSize > maxReadBytes ||
|
||||||
abs(req.end.offset) > maxSelectorOffset);
|
abs(req.begin.offset) > maxSelectorOffset ||
|
||||||
|
abs(req.end.offset) > maxSelectorOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
|
@ -5342,7 +5344,7 @@ ACTOR Future<Void> getKeyQ(StorageServer* data, GetKeyRequest req) {
|
||||||
int maxSelectorOffset =
|
int maxSelectorOffset =
|
||||||
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
data->latencyBandConfig.get().readConfig.maxKeySelectorOffset.orDefault(std::numeric_limits<int>::max());
|
||||||
data->counters.readLatencyBands.addMeasurement(
|
data->counters.readLatencyBands.addMeasurement(
|
||||||
duration, resultSize > maxReadBytes || abs(req.sel.offset) > maxSelectorOffset);
|
duration, 1, Filtered(resultSize > maxReadBytes || abs(req.sel.offset) > maxSelectorOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Void();
|
return Void();
|
||||||
|
|
Loading…
Reference in New Issue