Got rid of detailed field in GetRateInfoReply message
This commit is contained in:
parent
f3a73963b4
commit
07f800eeee
|
@ -69,11 +69,10 @@ struct GetRateInfoReply {
|
|||
double transactionRate;
|
||||
double leaseDuration;
|
||||
HealthMetrics healthMetrics;
|
||||
bool detailed;
|
||||
|
||||
template <class Ar>
|
||||
void serialize(Ar& ar) {
|
||||
serializer(ar, transactionRate, leaseDuration, healthMetrics, detailed);
|
||||
serializer(ar, transactionRate, leaseDuration, healthMetrics);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -93,6 +93,7 @@ ACTOR Future<Void> getRate(UID myID, Reference<AsyncVar<ServerDBInfo>> db, int64
|
|||
state Future<Void> leaseTimeout = Never();
|
||||
state Future<GetRateInfoReply> reply = Never();
|
||||
state double lastDetailedReply = 0.0; // request detailed metrics immediately
|
||||
state bool expectingDetailedReply = false;
|
||||
|
||||
state int64_t lastTC = 0;
|
||||
|
||||
|
@ -113,6 +114,7 @@ ACTOR Future<Void> getRate(UID myID, Reference<AsyncVar<ServerDBInfo>> db, int64
|
|||
nextRequestTimer = Never();
|
||||
bool detailed = (g_network->now() - lastDetailedReply > SERVER_KNOBS->DETAILED_METRIC_UPDATE_RATE);
|
||||
reply = brokenPromiseToNever(db->get().distributor.get().getRateInfo.getReply(GetRateInfoRequest(myID, *inTransactionCount, detailed)));
|
||||
expectingDetailedReply = detailed;
|
||||
}
|
||||
when ( GetRateInfoReply rep = wait(reply) ) {
|
||||
reply = Never();
|
||||
|
@ -121,8 +123,8 @@ ACTOR Future<Void> getRate(UID myID, Reference<AsyncVar<ServerDBInfo>> db, int64
|
|||
lastTC = *inTransactionCount;
|
||||
leaseTimeout = delay(rep.leaseDuration);
|
||||
nextRequestTimer = delayJittered(rep.leaseDuration / 2);
|
||||
healthMetricsReply->update(rep.healthMetrics, rep.detailed, true);
|
||||
if (rep.detailed) {
|
||||
healthMetricsReply->update(rep.healthMetrics, expectingDetailedReply, true);
|
||||
if (expectingDetailedReply) {
|
||||
detailedHealthMetricsReply->update(rep.healthMetrics, true, true);
|
||||
lastDetailedReply = g_network->now();
|
||||
}
|
||||
|
|
|
@ -580,7 +580,6 @@ ACTOR Future<Void> rateKeeper(
|
|||
|
||||
reply.healthMetrics.update(self.healthMetrics, false, false);
|
||||
reply.healthMetrics.tpsLimit = self.TPSLimit;
|
||||
reply.detailed = req.detailed;
|
||||
if (req.detailed) {
|
||||
for (const auto &s : self.storageQueueInfo) {
|
||||
self.healthMetrics.storageStats[s.key].cpuUsage = s.value.lastReply.cpuUsage;
|
||||
|
|
Loading…
Reference in New Issue