summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats/counters.cpp
diff options
context:
space:
mode:
authorAdam Rayner <adam.rayner@mongodb.com>2022-12-08 00:34:24 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-08 01:10:06 +0000
commit2ef48c1f09b573d0209d1a81a7ee33f2737b82d1 (patch)
tree8eb6da1ca6cc517678f538583980211d676d3649 /src/mongo/db/stats/counters.cpp
parent92d88de2597d65f92bfa96472c68f08c69d170bb (diff)
downloadmongo-2ef48c1f09b573d0209d1a81a7ee33f2737b82d1.tar.gz
SERVER-67886: Log metrics around authentication protocols
Diffstat (limited to 'src/mongo/db/stats/counters.cpp')
-rw-r--r--src/mongo/db/stats/counters.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp
index 23ea8c46212..7d4a0b30047 100644
--- a/src/mongo/db/stats/counters.cpp
+++ b/src/mongo/db/stats/counters.cpp
@@ -219,6 +219,10 @@ void AuthCounter::incSaslSupportedMechanismsReceived() {
_saslSupportedMechanismsReceived.fetchAndAddRelaxed(1);
}
+void AuthCounter::incAuthenticationCumulativeTime(long long micros) {
+ _authenticationCumulativeMicros.fetchAndAddRelaxed(micros);
+}
+
void AuthCounter::MechanismCounterHandle::incSpeculativeAuthenticateReceived() {
_data->speculativeAuthenticate.received.fetchAndAddRelaxed(1);
}
@@ -310,6 +314,9 @@ void AuthCounter::append(BSONObjBuilder* b) {
}
mechsBuilder.done();
+
+ const auto totalAuthenticationTimeMicros = _authenticationCumulativeMicros.load();
+ b->append("totalAuthenticationTimeMicros", totalAuthenticationTimeMicros);
}
OpCounterServerStatusSection::OpCounterServerStatusSection(const std::string& sectionName,