Skip to content

Commit

Permalink
use unique pointer (#11408)
Browse files Browse the repository at this point in the history
Co-authored-by: Dan Lambright <[email protected]>
  • Loading branch information
dlambrig and Dan Lambright authored May 20, 2024
1 parent c97f8dd commit 4bda00a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
11 changes: 6 additions & 5 deletions fdbserver/GrvProxyServer.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ struct GrvProxyData {
Optional<LatencyBandConfig> latencyBandConfig;
double lastStartCommit;
double lastCommitLatency;
LatencySample* versionVectorSizeOnGRVReply = nullptr;
std::unique_ptr<LatencySample> versionVectorSizeOnGRVReply;
int updateCommitRequests;
NotifiedDouble lastCommitTime;

Expand Down Expand Up @@ -238,10 +238,11 @@ struct GrvProxyData {
version(0), minKnownCommittedVersion(invalidVersion),
tagThrottler(CLIENT_KNOBS->PROXY_MAX_TAG_THROTTLE_DURATION) {
if (SERVER_KNOBS->ENABLE_VERSION_VECTOR) {
versionVectorSizeOnGRVReply = new LatencySample("VersionVectorSizeOnGRVReply",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
versionVectorSizeOnGRVReply =
std::make_unique<LatencySample>("VersionVectorSizeOnGRVReply",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
}
}
};
Expand Down
6 changes: 3 additions & 3 deletions fdbserver/include/fdbserver/MasterData.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ struct SWIFT_CXX_REF_MASTERDATA MasterData : NonCopyable, ReferenceCounted<Maste
CounterValue reportLiveCommittedVersionRequests;
// This counter gives an estimate of the number of non-empty peeks that storage servers
// should do from tlogs (in the worst case, ignoring blocking peek timeouts).
LatencySample* versionVectorTagUpdates = nullptr;
std::unique_ptr<LatencySample> versionVectorTagUpdates;
CounterValue waitForPrevCommitRequests;
CounterValue nonWaitForPrevCommitRequests;
LatencySample* versionVectorSizeOnCVReply = nullptr;
LatencySample* waitForPrevLatencies = nullptr;
std::unique_ptr<LatencySample> versionVectorSizeOnCVReply;
std::unique_ptr<LatencySample> waitForPrevLatencies;

PromiseStream<Future<Void>> addActor;

Expand Down
24 changes: 12 additions & 12 deletions fdbserver/masterserver.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@ MasterData::MasterData(Reference<AsyncVar<ServerDBInfo> const> const& dbInfo,
locality = tagLocalityInvalid;

if (SERVER_KNOBS->ENABLE_VERSION_VECTOR) {
versionVectorTagUpdates = new LatencySample("VersionVectorTagUpdates",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
versionVectorSizeOnCVReply = new LatencySample("VersionVectorSizeOnCVReply",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
waitForPrevLatencies = new LatencySample("WaitForPrevLatencies",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
versionVectorTagUpdates = std::make_unique<LatencySample>("VersionVectorTagUpdates",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
versionVectorSizeOnCVReply = std::make_unique<LatencySample>("VersionVectorSizeOnCVReply",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
waitForPrevLatencies = std::make_unique<LatencySample>("WaitForPrevLatencies",
dbgid,
SERVER_KNOBS->LATENCY_METRICS_LOGGING_INTERVAL,
SERVER_KNOBS->LATENCY_SKETCH_ACCURACY);
}

#ifdef WITH_SWIFT
Expand Down

0 comments on commit 4bda00a

Please sign in to comment.