ShardStats extends AbstractMXBean implements ShardStatsMXBean { @Override public long getCommittedTransactionsCount() { return committedTransactionsCount; } ShardStats(final String shardName, final String mxBeanType, final @Nullable Shard shard); @Override String getShardName(); @Override long getCommittedTransactionsCount(); @Override String getLeader(); @Override String getRaftState(); @Override long getReadOnlyTransactionCount(); @Override long getReadWriteTransactionCount(); @Override long getLastLogIndex(); @Override long getLastLogTerm(); @Override long getCurrentTerm(); @Override long getCommitIndex(); @Override long getLastApplied(); @Override long getLastIndex(); @Override long getLastTerm(); @Override long getSnapshotIndex(); @Override long getSnapshotTerm(); @Override long getReplicatedToAllIndex(); @Override String getVotedFor(); @Override boolean isVoting(); @Override String getPeerVotingStates(); @Override boolean isSnapshotCaptureInitiated(); @Override String getLastCommittedTransactionTime(); @Override long getFailedTransactionsCount(); @Override long getFailedReadTransactionsCount(); @Override long getAbortTransactionsCount(); long incrementCommittedTransactionCount(); long incrementReadOnlyTransactionCount(); long incrementReadWriteTransactionCount(); long incrementFailedTransactionsCount(); long incrementFailedReadTransactionsCount(); long incrementAbortTransactionsCount(); void setLastCommittedTransactionTime(final long lastCommittedTransactionTime); @Override long getInMemoryJournalDataSize(); @Override long getInMemoryJournalLogSize(); @Override void resetTransactionCounters(); void setFollowerInitialSyncStatus(final boolean followerInitialSyncStatus); @Override boolean getFollowerInitialSyncStatus(); @Override List<FollowerInfo> getFollowerInfo(); @Override String getPeerAddresses(); @Override String getStatRetrievalTime(); @Override String getStatRetrievalError(); @Override long getLeadershipChangeCount(); void incrementLeadershipChangeCount(); @Override String getLastLeadershipChangeTime(); @Override int getPendingTxCommitQueueSize(); @Override int getTxCohortCacheSize(); @Override void captureSnapshot(); static final String JMX_CATEGORY_SHARD; }
@Test public void testGetCommittedTransactionsCount() throws Exception { shardStats.incrementCommittedTransactionCount(); shardStats.incrementCommittedTransactionCount(); shardStats.incrementCommittedTransactionCount(); Object attribute = mbeanServer.getAttribute(testMBeanName, "CommittedTransactionsCount"); Assert.assertEquals(attribute, 3L); }