File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/stats Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ public double getMessageExpiryRate() {
173173 return msgExpired .getRate ();
174174 }
175175
176+ public long getMessageExpiryCount () {
177+ return msgExpired .getCount ();
178+ }
179+
176180 public long getTotalMessageExpired () {
177181 return totalMsgExpired .sum ();
178182 }
Original file line number Diff line number Diff line change @@ -1348,6 +1348,7 @@ public CompletableFuture<SubscriptionStatsImpl> getStatsAsync(GetStatsOptions ge
13481348 }
13491349 subStats .msgBacklogNoDelayed = subStats .msgBacklog - subStats .msgDelayed ;
13501350 subStats .msgRateExpired = expiryMonitor .getMessageExpiryRate ();
1351+ subStats .msgExpired = expiryMonitor .getMessageExpiryCount ();
13511352 subStats .totalMsgExpired = expiryMonitor .getTotalMessageExpired ();
13521353 subStats .isReplicated = isReplicated ();
13531354 subStats .subscriptionProperties = subscriptionProperties ;
Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ public class SubscriptionStatsImpl implements SubscriptionStats {
9393 /** Total rate of messages expired on this subscription (msg/s). */
9494 public double msgRateExpired ;
9595
96+ /** The count of expired messages on this subscription. */
97+ public long msgExpired ;
98+
9699 /** Total messages expired on this subscription. */
97100 public long totalMsgExpired ;
98101
@@ -209,6 +212,7 @@ public void reset() {
209212 unackedMessages = 0 ;
210213 type = null ;
211214 msgRateExpired = 0 ;
215+ msgExpired = 0 ;
212216 totalMsgExpired = 0 ;
213217 lastExpireTimestamp = 0L ;
214218 lastMarkDeleteAdvancedTimestamp = 0L ;
@@ -254,6 +258,7 @@ public SubscriptionStatsImpl add(SubscriptionStatsImpl stats) {
254258 this .unackedMessages += stats .unackedMessages ;
255259 this .type = stats .type ;
256260 this .msgRateExpired += stats .msgRateExpired ;
261+ this .msgExpired += stats .msgExpired ;
257262 this .totalMsgExpired += stats .totalMsgExpired ;
258263 this .isReplicated |= stats .isReplicated ;
259264 this .isDurable |= stats .isDurable ;
You can’t perform that action at this time.
0 commit comments