BUG-5280: update transaction statistics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / AbstractFrontendHistory.java
index f6dee7ce7b32705a333fbf7f5cc23f5eb410a5ef..b7bd46c738d8a6fa5f55ecb09933048592b27c30 100644 (file)
@@ -170,16 +170,19 @@ abstract class AbstractFrontendHistory implements Identifiable<LocalHistoryIdent
             throws RequestException {
         if (request instanceof CommitLocalTransactionRequest) {
             LOG.debug("{}: allocating new ready transaction {}", persistenceId(), id);
             throws RequestException {
         if (request instanceof CommitLocalTransactionRequest) {
             LOG.debug("{}: allocating new ready transaction {}", persistenceId(), id);
+            tree.getStats().incrementReadWriteTransactionCount();
             return createReadyTransaction(id, ((CommitLocalTransactionRequest) request).getModification());
         }
         if (request instanceof AbstractReadTransactionRequest) {
             if (((AbstractReadTransactionRequest<?>) request).isSnapshotOnly()) {
                 LOG.debug("{}: allocatint new open snapshot {}", persistenceId(), id);
             return createReadyTransaction(id, ((CommitLocalTransactionRequest) request).getModification());
         }
         if (request instanceof AbstractReadTransactionRequest) {
             if (((AbstractReadTransactionRequest<?>) request).isSnapshotOnly()) {
                 LOG.debug("{}: allocatint new open snapshot {}", persistenceId(), id);
+                tree.getStats().incrementReadOnlyTransactionCount();
                 return createOpenSnapshot(id);
             }
         }
 
         LOG.debug("{}: allocating new open transaction {}", persistenceId(), id);
                 return createOpenSnapshot(id);
             }
         }
 
         LOG.debug("{}: allocating new open transaction {}", persistenceId(), id);
+        tree.getStats().incrementReadWriteTransactionCount();
         return createOpenTransaction(id);
     }
 
         return createOpenTransaction(id);
     }