Skip to content

Commit 90d72ae

Browse files
authored
fix vsf load wait metric in ChannelCounters snapshot (apache#19008)
1 parent 896a692 commit 90d72ae

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

multi-stage-query/src/main/java/org/apache/druid/msq/counters/ChannelCounters.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public long[] getLoadTime()
365365
@JsonInclude(JsonInclude.Include.NON_NULL)
366366
public long[] getLoadWait()
367367
{
368-
return loadTime;
368+
return loadWait;
369369
}
370370

371371
@JsonProperty
@@ -392,6 +392,7 @@ public boolean equals(Object o)
392392
&& Arrays.equals(totalFiles, snapshot.totalFiles)
393393
&& Arrays.equals(loadBytes, snapshot.loadBytes)
394394
&& Arrays.equals(loadTime, snapshot.loadTime)
395+
&& Arrays.equals(loadWait, snapshot.loadWait)
395396
&& Arrays.equals(loadFiles, snapshot.loadFiles);
396397
}
397398

@@ -405,6 +406,7 @@ public int hashCode()
405406
result = 31 * result + Arrays.hashCode(totalFiles);
406407
result = 31 * result + Arrays.hashCode(loadBytes);
407408
result = 31 * result + Arrays.hashCode(loadTime);
409+
result = 31 * result + Arrays.hashCode(loadWait);
408410
result = 31 * result + Arrays.hashCode(loadFiles);
409411
return result;
410412
}
@@ -420,6 +422,7 @@ public String toString()
420422
", totalFiles=" + Arrays.toString(totalFiles) +
421423
", loadBytes=" + Arrays.toString(loadBytes) +
422424
", loadTime=" + Arrays.toString(loadTime) +
425+
", loadWait=" + Arrays.toString(loadWait) +
423426
", loadFiles=" + Arrays.toString(loadFiles) +
424427
'}';
425428
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.druid.msq.counters;
21+
22+
import nl.jqno.equalsverifier.EqualsVerifier;
23+
import org.junit.jupiter.api.Test;
24+
25+
class ChannelCountersTest
26+
{
27+
@Test
28+
void testSnapshotEqualsAndHashcode()
29+
{
30+
EqualsVerifier.forClass(ChannelCounters.Snapshot.class).usingGetClass().verify();
31+
}
32+
}

0 commit comments

Comments
 (0)