This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 4ca11d3400c docs(stats): explain why topic msgOutCounter can exceed 
subscriptions sum (#1128)
4ca11d3400c is described below

commit 4ca11d3400cdcf9ad6f9233cb94891aff6600127
Author: Vishal Kumar Singh <[email protected]>
AuthorDate: Wed Apr 22 21:55:20 2026 +0530

    docs(stats): explain why topic msgOutCounter can exceed subscriptions sum 
(#1128)
    
    * docs(stats): explain why topic msgOutCounter can exceed subscriptions sum
    
    apache/pulsar#23701
    
    Topic-level bytesOutCounter and msgOutCounter are monotonic grand
    totals: when a subscription is removed (durable unsubscribe, or a
    non-durable reader closing), its accumulated stats are preserved in
    bytesOutFromRemovedSubscriptions / msgOutFromRemovedSubscriptions and
    added back into the topic counter. The per-subscription values in the
    "subscriptions" map only cover subscriptions still attached at the
    moment of the stats call, so the topic-level totals can legitimately
    be larger than the sum of subscription totals.
    
    Call this out in both the unversioned docs and the 4.2.x versioned
    copy for the topic-level Stats table.
    
    * Mirror stats description changes to 4.0.x LTS docs
    
    Made-with: Cursor
---
 docs/administration-stats.md                         | 4 ++--
 versioned_docs/version-4.0.x/administration-stats.md | 4 ++--
 versioned_docs/version-4.2.x/administration-stats.md | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/administration-stats.md b/docs/administration-stats.md
index 49cfea2c2ab..8366893dd5a 100644
--- a/docs/administration-stats.md
+++ b/docs/administration-stats.md
@@ -27,8 +27,8 @@ All stats below are **reset** to 0 upon broker restart or 
topic unloading, **exc
 | earliestMsgPublishTimeInBacklogs*                | The publish time of the 
earliest message in the backlog (in milliseconds).                              
                                                                                
                                                        |
 | bytesInCounter                                   | The total bytes published 
to the topic.                                                                   
                                                                                
                                                      |
 | msgInCounter                                     | The total messages 
published to the topic.                                                         
                                                                                
                                                             |
-| bytesOutCounter                                  | The total bytes delivered 
to consumers.                                                                   
                                                                                
                                                      |
-| msgOutCounter                                    | The total messages 
delivered to consumers.                                                         
                                                                                
                                                             |
+| bytesOutCounter                                  | The total bytes delivered 
to consumers on this topic, including delivery to non-durable subscriptions 
(readers). This is a monotonic counter and is not reset when a subscription is 
unsubscribed or a reader is closed, so the topic-level value can be greater 
than the sum of `bytesOutCounter` across the subscriptions currently reported 
in `subscriptions` (closed readers and unsubscribed durable subscriptions no 
longer appear in stats, but [...]
+| msgOutCounter                                    | The total messages 
delivered to consumers on this topic, including delivery to non-durable 
subscriptions (readers). This is a monotonic counter and is not reset when a 
subscription is unsubscribed or a reader is closed, so the topic-level value 
can be greater than the sum of `msgOutCounter` across the subscriptions 
currently reported in `subscriptions` (closed readers and unsubscribed durable 
subscriptions no longer appear in stats, bu [...]
 | msgChunkPublished                                | The topics that have 
chunked messages published on it.                                               
                                                                                
                                                           |
 | backlogSize*                                     | The estimated total 
unconsumed or backlog size (in bytes).                                          
                                                                                
                                                            |
 | oldestBacklogMessageAgeSeconds                   | The age of the oldest 
unacknowledged (i.e. backlog) message, measured by the time elapsed from its 
published time, in seconds. This value is recorded every backlog quota check 
interval, hence it represents the value seen in the last check. |
diff --git a/versioned_docs/version-4.0.x/administration-stats.md 
b/versioned_docs/version-4.0.x/administration-stats.md
index 1f5f3a48a7b..e42e7dfb0aa 100644
--- a/versioned_docs/version-4.0.x/administration-stats.md
+++ b/versioned_docs/version-4.0.x/administration-stats.md
@@ -27,8 +27,8 @@ All stats below are **reset** to 0 upon broker restart or 
topic unloading, **exc
 | earliestMsgPublishTimeInBacklogs*                | The publish time of the 
earliest message in the backlog (in milliseconds).                              
                                                                                
                                                        |
 | bytesInCounter                                   | The total bytes published 
to the topic.                                                                   
                                                                                
                                                      |
 | msgInCounter                                     | The total messages 
published to the topic.                                                         
                                                                                
                                                             |
-| bytesOutCounter                                  | The total bytes delivered 
to consumers.                                                                   
                                                                                
                                                      |
-| msgOutCounter                                    | The total messages 
delivered to consumers.                                                         
                                                                                
                                                             |
+| bytesOutCounter                                  | The total bytes delivered 
to consumers on this topic, including delivery to non-durable subscriptions 
(readers). This is a monotonic counter and is not reset when a subscription is 
unsubscribed or a reader is closed, so the topic-level value can be greater 
than the sum of `bytesOutCounter` across the subscriptions currently reported 
in `subscriptions` (closed readers and unsubscribed durable subscriptions no 
longer appear in stats, but [...]
+| msgOutCounter                                    | The total messages 
delivered to consumers on this topic, including delivery to non-durable 
subscriptions (readers). This is a monotonic counter and is not reset when a 
subscription is unsubscribed or a reader is closed, so the topic-level value 
can be greater than the sum of `msgOutCounter` across the subscriptions 
currently reported in `subscriptions` (closed readers and unsubscribed durable 
subscriptions no longer appear in stats, bu [...]
 | msgChunkPublished                                | The topics that have 
chunked messages published on it.                                               
                                                                                
                                                           |
 | backlogSize*                                     | The estimated total 
unconsumed or backlog size (in bytes).                                          
                                                                                
                                                            |
 | oldestBacklogMessageAgeSeconds                   | The age of the oldest 
unacknowledged (i.e. backlog) message, measured by the time elapsed from its 
published time, in seconds. This value is recorded every backlog quota check 
interval, hence it represents the value seen in the last check. |
diff --git a/versioned_docs/version-4.2.x/administration-stats.md 
b/versioned_docs/version-4.2.x/administration-stats.md
index 49cfea2c2ab..8366893dd5a 100644
--- a/versioned_docs/version-4.2.x/administration-stats.md
+++ b/versioned_docs/version-4.2.x/administration-stats.md
@@ -27,8 +27,8 @@ All stats below are **reset** to 0 upon broker restart or 
topic unloading, **exc
 | earliestMsgPublishTimeInBacklogs*                | The publish time of the 
earliest message in the backlog (in milliseconds).                              
                                                                                
                                                        |
 | bytesInCounter                                   | The total bytes published 
to the topic.                                                                   
                                                                                
                                                      |
 | msgInCounter                                     | The total messages 
published to the topic.                                                         
                                                                                
                                                             |
-| bytesOutCounter                                  | The total bytes delivered 
to consumers.                                                                   
                                                                                
                                                      |
-| msgOutCounter                                    | The total messages 
delivered to consumers.                                                         
                                                                                
                                                             |
+| bytesOutCounter                                  | The total bytes delivered 
to consumers on this topic, including delivery to non-durable subscriptions 
(readers). This is a monotonic counter and is not reset when a subscription is 
unsubscribed or a reader is closed, so the topic-level value can be greater 
than the sum of `bytesOutCounter` across the subscriptions currently reported 
in `subscriptions` (closed readers and unsubscribed durable subscriptions no 
longer appear in stats, but [...]
+| msgOutCounter                                    | The total messages 
delivered to consumers on this topic, including delivery to non-durable 
subscriptions (readers). This is a monotonic counter and is not reset when a 
subscription is unsubscribed or a reader is closed, so the topic-level value 
can be greater than the sum of `msgOutCounter` across the subscriptions 
currently reported in `subscriptions` (closed readers and unsubscribed durable 
subscriptions no longer appear in stats, bu [...]
 | msgChunkPublished                                | The topics that have 
chunked messages published on it.                                               
                                                                                
                                                           |
 | backlogSize*                                     | The estimated total 
unconsumed or backlog size (in bytes).                                          
                                                                                
                                                            |
 | oldestBacklogMessageAgeSeconds                   | The age of the oldest 
unacknowledged (i.e. backlog) message, measured by the time elapsed from its 
published time, in seconds. This value is recorded every backlog quota check 
interval, hence it represents the value seen in the last check. |

Reply via email to