Skip to content

Commit 7a490e1

Browse files
committed
added comments on statistics in WriteAck
1 parent 312bb07 commit 7a490e1

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

topic/src/main/java/tech/ydb/topic/write/WriteAck.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ public Details getDetails() {
4141
}
4242

4343
/**
44-
* Obtain message write statistics
44+
* Returns write statistics associated with this write confirmation.
45+
* Note: The statistics may cover multiple messages confirmed together by the server.
46+
* Although this WriteAck corresponds to a single written message, the server may confirm several messages in a single response.
47+
* Therefore, the returned statistics may represent the combined data for all messages included in the same write confirmation from the server.
4548
* @return {@link Statistics} with timings if statistics are available or null otherwise
4649
*/
4750
public Statistics getStatistics() {
@@ -60,13 +63,27 @@ public long getOffset() {
6063
}
6164
}
6265

66+
/**
67+
* Messages batch statistics.
68+
* All messages within the batch are persisted together so write
69+
* statistics is for the whole messages batch.
70+
*/
6371
public static class Statistics {
6472
private final Duration persistingTime;
6573
private final Duration partitionQuotaWaitTime;
6674
private final Duration topicQuotaWaitTime;
6775
private final Duration maxQueueWaitTime;
6876
private final Duration minQueueWaitTime;
6977

78+
/**
79+
* Create the messages batch statistics object, for a single messages batch.
80+
*
81+
* @param persistingTime
82+
* @param partitionQuotaWaitTime
83+
* @param topicQuotaWaitTime
84+
* @param maxQueueWaitTime
85+
* @param minQueueWaitTime
86+
*/
7087
public Statistics(Duration persistingTime,
7188
Duration partitionQuotaWaitTime, Duration topicQuotaWaitTime,
7289
Duration maxQueueWaitTime, Duration minQueueWaitTime) {
@@ -77,22 +94,37 @@ public Statistics(Duration persistingTime,
7794
this.minQueueWaitTime = minQueueWaitTime;
7895
}
7996

97+
/**
98+
* @return Time spent in persisting of data.
99+
*/
80100
public Duration getPersistingTime() {
81101
return persistingTime;
82102
}
83103

104+
/**
105+
* @return Time spent awaiting for partition write quota.
106+
*/
84107
public Duration getPartitionQuotaWaitTime() {
85108
return partitionQuotaWaitTime;
86109
}
87110

111+
/**
112+
* @return Time spent awaiting for topic write quota.
113+
*/
88114
public Duration getTopicQuotaWaitTime() {
89115
return topicQuotaWaitTime;
90116
}
91117

118+
/**
119+
* @return Time spent in queue before persisting, maximal of all messages in response.
120+
*/
92121
public Duration getMaxQueueWaitTime() {
93122
return maxQueueWaitTime;
94123
}
95124

125+
/**
126+
* @return Time spent in queue before persisting, minimal of all messages in response.
127+
*/
96128
public Duration getMinQueueWaitTime() {
97129
return minQueueWaitTime;
98130
}

0 commit comments

Comments
 (0)