[SERVER-35308] Track total active time of transaction in SingleTransactionStats Created: 31/May/18  Updated: 29/Oct/23  Resolved: 22/Jun/18

Status: Closed
Project: Core Server
Component/s: Diagnostics, Replication
Affects Version/s: None
Fix Version/s: 4.0.2, 4.1.1

Type: Task Priority: Major - P3
Reporter: William Schultz (Inactive) Assignee: Jinny Byun
Resolution: Fixed Votes: 0
Labels: per-txn-metrics
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-35492 Rename TxnStats to SingleTransactionS... Closed
is depended on by SERVER-35310 Add timeActiveMicros and timeInactive... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-06-18, Repl 2018-07-02
Participants:

 Description   

We want to track the total amount of "active" and "inactive" time spent by a transaction in SingleTransactionStats. A transaction is considered "active" if it is currently executing an operation, and considered "inactive" if it is idly waiting for a new operation to occur. To measure "active" time, we can use the "unstash" and "stash" transaction events to mark the beginning and end of an "active" period. When an operation stashes its transaction resources, we should add that operation's total running time to a cumulative SingleTransactionStats::timeActive field on the session. Similarly, when the first operation on a transaction completes, we should add its running time to SingleTransactionStats::timeActive.



 Comments   
Comment by Githook User [ 15/Aug/18 ]

Author:

{'username': 'jinichu', 'email': 'jinnybyun@gmail.com', 'name': 'jinichu'}

Message: SERVER-35308 Added timeActiveMicros field to SingleTransactionStats to measure total active time

(cherry picked from commit cfb0b9ff7ca1a20c3c37edd2baf6e5c509c65aca)
Branch: v4.0
https://github.com/mongodb/mongo/commit/ac675fa326a0d721734823aed20e31797287af5e

Comment by Githook User [ 28/Jun/18 ]

Author:

{'username': 'jinichu', 'name': 'jinichu', 'email': 'jinnybyun@gmail.com'}

Message: SERVER-35308 Added call to SingleTransactionStats::setInactive() when transaction gets aborted under Session::commitTransaction()
Branch: master
https://github.com/mongodb/mongo/commit/a017b1eeced4a9bd5fad4481f7d42287790c1dda

Comment by Githook User [ 22/Jun/18 ]

Author:

{'username': 'jinichu', 'name': 'jinichu', 'email': 'jinnybyun@gmail.com'}

Message: SERVER-35308 Lint patch
Branch: master
https://github.com/mongodb/mongo/commit/3bba30acc5237ce80e0ed624be8a66cf161152da

Comment by Githook User [ 22/Jun/18 ]

Author:

{'username': 'jinichu', 'name': 'jinichu', 'email': 'jinnybyun@gmail.com'}

Message: SERVER-35308 Added timeActiveMicros field to SingleTransactionStats to measure total active time
Branch: master
https://github.com/mongodb/mongo/commit/cfb0b9ff7ca1a20c3c37edd2baf6e5c509c65aca

Generated at Thu Feb 08 04:39:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.