[SERVER-35129] Create a ServerTransactionsMetrics class and store it as a decoration on the ServiceContext Created: 21/May/18  Updated: 29/Oct/23  Resolved: 08/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: Nathan Louie
Resolution: Fixed Votes: 0
Labels: global-txn-metrics
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-35146 Track total number of started transac... Closed
is depended on by SERVER-35147 Track total number of committed and a... Closed
is depended on by SERVER-35149 Track total number of open transactio... Closed
is depended on by SERVER-35151 Track total number of active and inac... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-06-18
Participants:

 Description   

To store server-wide metrics on multi-document transactions, we need a class that will store these metrics and an instance of it that is globally accessible. We will follow the same pattern used by the RetryableWritesStats class. We will create a ServerTransactionsMetrics class and add it as a decoration on the ServiceContext. This class should initially be just a skeleton, until we add member variables to track various metrics. We should also include a dummy void ServerTransactionsMetrics::updateStats(TransactionsStats* stats) method, that mirrors the method of RetryableWritesStats. Once we start to track metrics in this class, the updateStats method will allow us to copy the stored metrics into a serializable TransactionStats object, suitable for output in serverStatus.

As a part of this ticket, we can call ServerTransactionsMetrics::updateStats from within TransactionsSSS::generateSection, even though it will initially do nothing.



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

Author:

{'username': 'nxlouie', 'email': 'nxlouie@umich.edu', 'name': 'Nathan Louie'}

Message: SERVER-35129 Create a ServerTransactionsMetrics class and store it as a decoration on the ServiceContext

(cherry picked from commit 77fdba110d24da099a73b46b16f1f3a5ab8ed849)
Branch: v4.0
https://github.com/mongodb/mongo/commit/9a7d4ef8543557347ef87e8f73b66e9d644569bd

Comment by Githook User [ 08/Jun/18 ]

Author:

{'username': 'nxlouie', 'name': 'Nathan Louie', 'email': 'nxlouie@umich.edu'}

Message: SERVER-35129 Create a ServerTransactionsMetrics class and store it as a decoration on the ServiceContext
Branch: master
https://github.com/mongodb/mongo/commit/77fdba110d24da099a73b46b16f1f3a5ab8ed849

Comment by William Schultz (Inactive) [ 07/Jun/18 ]

We've decided to rename the class from MultiDocumentTransactionsStats to ServerTransactionsMetrics.

Comment by William Schultz (Inactive) [ 06/Jun/18 ]

Fair enough. Jinny just committed SERVER-35126, so it's probably not worth changing it at this point, but I will keep that in mind going forward.

Comment by Spencer Brody (Inactive) [ 06/Jun/18 ]

FWIW I'm in favor of full names over inconsistent abbreviations, so I'd vote for TransactionStats over TxnStats.

Comment by William Schultz (Inactive) [ 06/Jun/18 ]

tess.avitabile We can do that as part of this ticket. I didn't call it out explicitly but I think I expected we would also add a call to the dummy function after we added it. I added a note in the description.

Comment by William Schultz (Inactive) [ 06/Jun/18 ]

There's no real significance. We aren't very consistent with the "txn" vs "transaction" naming convention throughout the codebase so it's not that important to me at this point. I think I decided on "MultiDocumentTransactionsStats" because the "TransactionsStats" IDL type and "TransactionsSSS" class already used that convention and it will be used in conjunction with that.

Comment by Nathan Louie [ 06/Jun/18 ]

What is the significance of writing out the word "Transactions" in this class, while the per-transaction stats class is called "TxnStats"?

Comment by Tess Avitabile (Inactive) [ 06/Jun/18 ]

In what ticket will we start calling MultiDocumentTransactionsStats::updateStats() from TransactionSSS?

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