@@ -41,7 +41,10 @@ public Details getDetails() {
41
41
}
42
42
43
43
/**
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.
45
48
* @return {@link Statistics} with timings if statistics are available or null otherwise
46
49
*/
47
50
public Statistics getStatistics () {
@@ -60,13 +63,27 @@ public long getOffset() {
60
63
}
61
64
}
62
65
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
+ */
63
71
public static class Statistics {
64
72
private final Duration persistingTime ;
65
73
private final Duration partitionQuotaWaitTime ;
66
74
private final Duration topicQuotaWaitTime ;
67
75
private final Duration maxQueueWaitTime ;
68
76
private final Duration minQueueWaitTime ;
69
77
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
+ */
70
87
public Statistics (Duration persistingTime ,
71
88
Duration partitionQuotaWaitTime , Duration topicQuotaWaitTime ,
72
89
Duration maxQueueWaitTime , Duration minQueueWaitTime ) {
@@ -77,22 +94,37 @@ public Statistics(Duration persistingTime,
77
94
this .minQueueWaitTime = minQueueWaitTime ;
78
95
}
79
96
97
+ /**
98
+ * @return Time spent in persisting of data.
99
+ */
80
100
public Duration getPersistingTime () {
81
101
return persistingTime ;
82
102
}
83
103
104
+ /**
105
+ * @return Time spent awaiting for partition write quota.
106
+ */
84
107
public Duration getPartitionQuotaWaitTime () {
85
108
return partitionQuotaWaitTime ;
86
109
}
87
110
111
+ /**
112
+ * @return Time spent awaiting for topic write quota.
113
+ */
88
114
public Duration getTopicQuotaWaitTime () {
89
115
return topicQuotaWaitTime ;
90
116
}
91
117
118
+ /**
119
+ * @return Time spent in queue before persisting, maximal of all messages in response.
120
+ */
92
121
public Duration getMaxQueueWaitTime () {
93
122
return maxQueueWaitTime ;
94
123
}
95
124
125
+ /**
126
+ * @return Time spent in queue before persisting, minimal of all messages in response.
127
+ */
96
128
public Duration getMinQueueWaitTime () {
97
129
return minQueueWaitTime ;
98
130
}
0 commit comments