mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-24 17:56:29 +00:00
Track transaction time
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user