jtuglu-netflix commented on code in PR #17847:
URL: https://github.com/apache/druid/pull/17847#discussion_r2066988222
##########
server/src/main/java/org/apache/druid/segment/realtime/SegmentGenerationMetrics.java:
##########
@@ -55,6 +56,23 @@ public class SegmentGenerationMetrics
private final AtomicLong maxSegmentHandoffTime = new
AtomicLong(NO_EMIT_SEGMENT_HANDOFF_TIME);
+ // Message gap accounting
+ private final AtomicLong minMessageGap = new AtomicLong(Long.MAX_VALUE);
+ private final AtomicLong maxMessageGap = new AtomicLong(Long.MIN_VALUE);
+ private final AtomicLong numMessageGap = new AtomicLong(0);
+ private final AtomicDouble avgMessageGap = new AtomicDouble(0);
Review Comment:
```
this.avgGapStats.getAndUpdate(oldValue ->
new Pair<>(oldValue.lhs + messageGap,
oldValue.rhs + 1)
);
```
since pair values are final I didn't see a way of doing modification
in-place. The ctor might be the overhead there.
##########
server/src/main/java/org/apache/druid/segment/realtime/SegmentGenerationMetrics.java:
##########
@@ -55,6 +56,23 @@ public class SegmentGenerationMetrics
private final AtomicLong maxSegmentHandoffTime = new
AtomicLong(NO_EMIT_SEGMENT_HANDOFF_TIME);
+ // Message gap accounting
+ private final AtomicLong minMessageGap = new AtomicLong(Long.MAX_VALUE);
+ private final AtomicLong maxMessageGap = new AtomicLong(Long.MIN_VALUE);
+ private final AtomicLong numMessageGap = new AtomicLong(0);
+ private final AtomicDouble avgMessageGap = new AtomicDouble(0);
Review Comment:
```java
this.avgGapStats.getAndUpdate(oldValue ->
new Pair<>(oldValue.lhs + messageGap,
oldValue.rhs + 1)
);
```
since pair values are final I didn't see a way of doing modification
in-place. The ctor might be the overhead there.
--
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]