Skip to content

Commit efc71fd

Browse files
committed
Ensure that inbound and outbound bucket should have the length of BUCKET_COUNT
1 parent de26a70 commit efc71fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/main/java/org/elasticsearch/transport/TransportStats.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ public void writeTo(StreamOutput out) throws IOException {
9696
out.writeVLong(rxSize);
9797
out.writeVLong(txCount);
9898
out.writeVLong(txSize);
99-
assert (inboundHandlingTimeBucketFrequencies.length > 0) == (outboundHandlingTimeBucketFrequencies.length > 0);
99+
assert inboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
100+
assert outboundHandlingTimeBucketFrequencies.length == HandlingTimeTracker.BUCKET_COUNT;
100101
if (out.getTransportVersion().before(TransportVersions.TRANSPORT_STATS_HANDLING_TIME_REQUIRED)) {
101-
out.writeBoolean(inboundHandlingTimeBucketFrequencies.length > 0);
102+
out.writeBoolean(true);
102103
}
103104
for (long handlingTimeBucketFrequency : inboundHandlingTimeBucketFrequencies) {
104105
out.writeVLong(handlingTimeBucketFrequency);

0 commit comments

Comments
 (0)