Skip to content

Commit

Permalink
[improve][broker] Add active status into cursor stats (apache#17884)
Browse files Browse the repository at this point in the history
  • Loading branch information
HQebupt authored Oct 1, 2022
1 parent 6651bbb commit 8c1152c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4116,6 +4116,7 @@ public CompletableFuture<ManagedLedgerInternalStats> getManagedLedgerInternalSta
cs.individuallyDeletedMessages = cursor.getIndividuallyDeletedMessages();
cs.lastLedgerSwitchTimestamp = DateFormatter.format(cursor.getLastLedgerSwitchTimestamp());
cs.state = cursor.getState();
cs.active = cursor.isActive();
cs.numberOfEntriesSinceFirstNotAckedMessage = cursor.getNumberOfEntriesSinceFirstNotAckedMessage();
cs.totalNonContiguousDeletedMessagesRange = cursor.getTotalNonContiguousDeletedMessagesRange();
cs.properties = cursor.getProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,7 @@ public CompletableFuture<PersistentTopicInternalStats> getInternalStats(boolean
cs.individuallyDeletedMessages = cursor.getIndividuallyDeletedMessages();
cs.lastLedgerSwitchTimestamp = DateFormatter.format(cursor.getLastLedgerSwitchTimestamp());
cs.state = cursor.getState();
cs.active = cursor.isActive();
cs.numberOfEntriesSinceFirstNotAckedMessage = cursor.getNumberOfEntriesSinceFirstNotAckedMessage();
cs.totalNonContiguousDeletedMessagesRange = cursor.getTotalNonContiguousDeletedMessagesRange();
cs.properties = cursor.getProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public void testTopicInternalStats() throws Exception {
&& (cursor.totalNonContiguousDeletedMessagesRange) < numberOfMsgs / 2);
assertFalse(cursor.subscriptionHavePendingRead);
assertFalse(cursor.subscriptionHavePendingReplayRead);
assertTrue(cursor.active);
producer.close();
consumer.close();
log.info("-- Exiting {} test --", methodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static class CursorStats {
public String individuallyDeletedMessages;
public String lastLedgerSwitchTimestamp;
public String state;
public boolean active;
public long numberOfEntriesSinceFirstNotAckedMessage;
public int totalNonContiguousDeletedMessagesRange;
public boolean subscriptionHavePendingRead;
Expand Down

0 comments on commit 8c1152c

Please sign in to comment.