FrankChen021 commented on code in PR #19494:
URL: https://github.com/apache/druid/pull/19494#discussion_r3281511146
##########
server/src/main/java/org/apache/druid/segment/loading/VirtualStorageLocationStats.java:
##########
@@ -86,4 +86,23 @@ public interface VirtualStorageLocationStats
* Number of operations which could not be loaded due to insufficient space
during the measurement period
*/
long getRejectCount();
+
+ /**
+ * Whether any stats are nonzero.
+ */
+ default boolean hasStats()
+ {
+ return getUsedBytes() != 0
+ || getHitCount() != 0
+ || getHoldBytes() != 0
Review Comment:
[P2] Include hold count when deciding whether to emit virtual stats
StorageMonitor now skips all virtual-storage emissions unless
`weakStats.hasStats()` returns true, but this predicate checks `getHitCount()`
twice and never checks `getHoldCount()`. If a virtual cache location has active
holds with zero held bytes, which can happen for zero-sized/tombstone segments,
`storage/virtual/hold/count` is nonzero but the whole virtual metric block is
suppressed. Include `getHoldCount()` in this predicate so the hold-count metric
is emitted whenever it is nonzero.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]