Skip to content

Commit ac350d9

Browse files
change names and types
1 parent ca5c9f6 commit ac350d9

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

server/src/internalClusterTest/java/org/elasticsearch/index/shard/IndexShardIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ public void testNodeWriteLoadsArePresent() {
333333
NodeWriteLoad nodeWriteLoad = nodeWriteLoads.get(node.getId());
334334
assertThat(nodeWriteLoad.nodeId(), equalTo(node.getId()));
335335
assertThat(nodeWriteLoad.totalWriteThreadPoolThreads(), greaterThanOrEqualTo(0));
336-
assertThat(nodeWriteLoad.percentWriteThreadPoolUtilization(), greaterThanOrEqualTo(0));
337-
assertThat(nodeWriteLoad.maxTaskTimeInWriteQueueMillis(), greaterThanOrEqualTo(0L));
336+
assertThat(nodeWriteLoad.averageWriteThreadPoolUtilization(), greaterThanOrEqualTo(0.0f));
337+
assertThat(nodeWriteLoad.averageWriteThreadPoolQueueLatencyMillis(), greaterThanOrEqualTo(0L));
338338
}
339339
} finally {
340340
updateClusterSettings(

server/src/main/java/org/elasticsearch/cluster/NodeWriteLoad.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
*
2121
* @param nodeId Node ID.
2222
* @param totalWriteThreadPoolThreads Total number of threads in the write thread pool.
23-
* @param percentWriteThreadPoolUtilization Percent of write thread pool threads that are in use, averaged over some period of time.
24-
* @param maxTaskTimeInWriteQueueMillis How long the oldest task (next to be run) in the write thread pool queue has been queued. Zero if
25-
* there is no write thread pool queue.
23+
* @param averageWriteThreadPoolUtilization Percent of write thread pool threads that are in use, averaged over some period of time.
24+
* @param averageWriteThreadPoolQueueLatencyMillis How much time tasks spend in the write thread pool queue. Zero if there is nothing being
25+
* queued in the write thread pool.
2626
*/
2727
public record NodeWriteLoad(
2828
String nodeId,
2929
int totalWriteThreadPoolThreads,
30-
int percentWriteThreadPoolUtilization,
31-
long maxTaskTimeInWriteQueueMillis
30+
float averageWriteThreadPoolUtilization,
31+
long averageWriteThreadPoolQueueLatencyMillis
3232
) implements Writeable {
3333

3434
public NodeWriteLoad(StreamInput in) throws IOException {
@@ -39,8 +39,8 @@ public NodeWriteLoad(StreamInput in) throws IOException {
3939
public void writeTo(StreamOutput out) throws IOException {
4040
out.writeString(this.nodeId);
4141
out.writeVInt(this.totalWriteThreadPoolThreads);
42-
out.writeVInt(this.percentWriteThreadPoolUtilization);
43-
out.writeVLong(this.maxTaskTimeInWriteQueueMillis);
42+
out.writeDouble(this.averageWriteThreadPoolUtilization);
43+
out.writeVLong(this.averageWriteThreadPoolQueueLatencyMillis);
4444
}
4545

4646
@Override
@@ -50,8 +50,8 @@ public boolean equals(Object o) {
5050
NodeWriteLoad other = (NodeWriteLoad) o;
5151
return nodeId.equals(other.nodeId)
5252
&& totalWriteThreadPoolThreads == other.totalWriteThreadPoolThreads
53-
&& percentWriteThreadPoolUtilization == other.percentWriteThreadPoolUtilization
54-
&& maxTaskTimeInWriteQueueMillis == other.maxTaskTimeInWriteQueueMillis;
53+
&& averageWriteThreadPoolUtilization == other.averageWriteThreadPoolUtilization
54+
&& averageWriteThreadPoolQueueLatencyMillis == other.averageWriteThreadPoolQueueLatencyMillis;
5555
}
5656

5757
@Override
@@ -61,10 +61,10 @@ public String toString() {
6161
+ nodeId
6262
+ "], totalWriteThreadPoolThreads=["
6363
+ totalWriteThreadPoolThreads
64-
+ "], percentWriteThreadPoolUtilization=["
65-
+ percentWriteThreadPoolUtilization
66-
+ "], maxTaskTimeInWriteQueueMillis=["
67-
+ maxTaskTimeInWriteQueueMillis
64+
+ "], averageWriteThreadPoolUtilization=["
65+
+ averageWriteThreadPoolUtilization
66+
+ "], averageWriteThreadPoolQueueLatencyMillis=["
67+
+ averageWriteThreadPoolQueueLatencyMillis
6868
+ "]}";
6969
}
7070

server/src/test/java/org/elasticsearch/cluster/ClusterInfoTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ private static Map<String, NodeWriteLoad> randomNodeWriteLoads() {
7070
String nodeIdKey = randomAlphaOfLength(32);
7171
final NodeWriteLoad nodeWriteLoad = new NodeWriteLoad(/* nodeId= */ nodeIdKey,
7272
/* totalWriteThreadPoolThreads= */ randomIntBetween(1, 16),
73-
/* percentWriteThreadPoolUtilization= */randomIntBetween(0, 100),
74-
/* maxTaskTimeInWriteQueueMillis= */ randomLongBetween(0, 50000)
73+
/* averageWriteThreadPoolUtilization= */randomIntBetween(0, 100),
74+
/* averageWriteThreadPoolQueueLatencyMillis= */ randomLongBetween(0, 50000)
7575
);
7676
nodeWriteLoads.put(nodeIdKey, nodeWriteLoad);
7777
}

0 commit comments

Comments
 (0)