Track transaction time

This commit is contained in:
Sean McGivern
2024-09-05 17:15:58 +01:00
parent cbf4d58144
commit 04e346df80
4 changed files with 56 additions and 12 deletions

View File

@@ -1204,9 +1204,12 @@ where
if !server.in_transaction() {
// Report transaction executed statistics.
self.stats.transaction();
server
.stats()
.transaction(self.server_parameters.get_application_name());
server.stats().transaction(
Instant::now()
.duration_since(server.transaction_start().into())
.as_millis() as u64,
self.server_parameters.get_application_name(),
);
// Release server back to the pool if we are in transaction mode.
// If we are in session mode, we keep the server until the client disconnects.
@@ -1460,9 +1463,12 @@ where
if !server.in_transaction() {
self.stats.transaction();
server
.stats()
.transaction(self.server_parameters.get_application_name());
server.stats().transaction(
Instant::now()
.duration_since(server.transaction_start().into())
.as_millis() as u64,
self.server_parameters.get_application_name(),
);
// Release server back to the pool if we are in transaction mode.
// If we are in session mode, we keep the server until the client disconnects.
@@ -1511,9 +1517,12 @@ where
if !server.in_transaction() {
self.stats.transaction();
server
.stats()
.transaction(self.server_parameters.get_application_name());
server.stats().transaction(
Instant::now()
.duration_since(server.transaction_start().into())
.as_millis() as u64,
self.server_parameters.get_application_name(),
);
// Release server back to the pool if we are in transaction mode.
// If we are in session mode, we keep the server until the client disconnects.