Pankraz76 commented on code in PR #21201:
URL: https://github.com/apache/kafka/pull/21201#discussion_r2639310490


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java:
##########
@@ -150,12 +150,12 @@ public int hashCode() {
     public static final String OPERATIONS = " operations";
     public static final String TOTAL_DESCRIPTION = "The total number of ";
     public static final String RATE_DESCRIPTION = "The average per-second 
number of ";
-    public static final String RATIO_DESCRIPTION = "The fraction of time the 
thread spent on ";
     public static final String AVG_LATENCY_DESCRIPTION = "The average latency 
of ";
     public static final String MAX_LATENCY_DESCRIPTION = "The maximum latency 
of ";
     public static final String LATENCY_DESCRIPTION_SUFFIX = " in milliseconds";
     public static final String RATE_DESCRIPTION_PREFIX = "The average number 
of ";
     public static final String RATE_DESCRIPTION_SUFFIX = " per second";
+    public static final String WINDOWED_RATIO_DESCRIPTION_PREFIX = "The ratio, 
over a rolling measurement window, ";

Review Comment:
   ```suggestion
       public static final String WINDOWED_RATIO_DESCRIPTION_PREFIX = "The 
ratio, over a rolling measurement window, of the time this thread spent ";
   ```
   is it only used like this?



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdater.java:
##########
@@ -1035,10 +1093,10 @@ private Stream<Task> streamOfNonPausedTasks() {
     private class StateUpdaterMetrics {
         private static final String STATE_LEVEL_GROUP = 
"stream-state-updater-metrics";
 
-        private static final String IDLE_RATIO_DESCRIPTION = RATIO_DESCRIPTION 
+ "being idle";
-        private static final String RESTORE_RATIO_DESCRIPTION = 
RATIO_DESCRIPTION + "restoring active tasks";
-        private static final String UPDATE_RATIO_DESCRIPTION = 
RATIO_DESCRIPTION + "updating standby tasks";
-        private static final String CHECKPOINT_RATIO_DESCRIPTION = 
RATIO_DESCRIPTION + "checkpointing tasks restored progress";
+        private static final String IDLE_RATIO_DESCRIPTION = 
WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spend being idle";
+        private static final String RESTORE_RATIO_DESCRIPTION = 
WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spend restoring 
active tasks";

Review Comment:
   ```suggestion
           private static final String RESTORE_RATIO_DESCRIPTION = 
WINDOWED_RATIO_DESCRIPTION_PREFIX + " restoring active tasks";
   ```
   
   not sure about this one
   
   spent
   
   
   <img width="338" height="107" alt="Image" 
src="https://github.com/user-attachments/assets/c474a5e7-0503-4d4e-8f94-3e3ebec7b222";
 />
   
   
   spend
   
   <img width="786" height="808" alt="Image" 
src="https://github.com/user-attachments/assets/3e2b19ac-c198-4e66-a038-347d49f225a1";
 />
   
   
   idk if this is any good, all I know this string occurs 22 times making it 
kind of dry.
   
   "of the time this thread spen"
   
   
   
   <img width="272" height="31" alt="Image" 
src="https://github.com/user-attachments/assets/c92a58fa-45c0-4291-b3c3-7227fd790336";
 />



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetrics.java:
##########
@@ -82,16 +83,16 @@ private ThreadMetrics() {}
     private static final String PUNCTUATE_AVG_LATENCY_DESCRIPTION = "The 
average punctuate latency";
     private static final String PUNCTUATE_MAX_LATENCY_DESCRIPTION = "The 
maximum punctuate latency";
     private static final String PROCESS_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +

Review Comment:
   ```suggestion
           WINDOWED_RATIO_DESCRIPTION_PREFIX +
   ```



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetrics.java:
##########
@@ -82,16 +83,16 @@ private ThreadMetrics() {}
     private static final String PUNCTUATE_AVG_LATENCY_DESCRIPTION = "The 
average punctuate latency";
     private static final String PUNCTUATE_MAX_LATENCY_DESCRIPTION = "The 
maximum punctuate latency";
     private static final String PROCESS_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "processing active tasks to the total elapsed time in that 
window.";
     private static final String PUNCTUATE_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +

Review Comment:
   ```suggestion
           WINDOWED_RATIO_DESCRIPTION_PREFIX +
   ```
   dry



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetrics.java:
##########
@@ -82,16 +83,16 @@ private ThreadMetrics() {}
     private static final String PUNCTUATE_AVG_LATENCY_DESCRIPTION = "The 
average punctuate latency";
     private static final String PUNCTUATE_MAX_LATENCY_DESCRIPTION = "The 
maximum punctuate latency";
     private static final String PROCESS_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "processing active tasks to the total elapsed time in that 
window.";
     private static final String PUNCTUATE_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "punctuating active tasks to the total elapsed time in that 
window.";
     private static final String POLL_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "polling records from the consumer to the total elapsed time in 
that window.";
     private static final String COMMIT_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +

Review Comment:
   ```suggestion
           WINDOWED_RATIO_DESCRIPTION_PREFIX +
   ```
   dry.



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/ThreadMetrics.java:
##########
@@ -82,16 +83,16 @@ private ThreadMetrics() {}
     private static final String PUNCTUATE_AVG_LATENCY_DESCRIPTION = "The 
average punctuate latency";
     private static final String PUNCTUATE_MAX_LATENCY_DESCRIPTION = "The 
maximum punctuate latency";
     private static final String PROCESS_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "processing active tasks to the total elapsed time in that 
window.";
     private static final String PUNCTUATE_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +
             "punctuating active tasks to the total elapsed time in that 
window.";
     private static final String POLL_RATIO_DESCRIPTION =
-        "The ratio, over a rolling measurement window, of the time this thread 
spent " +
+        WINDOWED_RATIO_DESCRIPTION_PREFIX + "of the time this thread spent " +

Review Comment:
   ```suggestion
           WINDOWED_RATIO_DESCRIPTION_PREFIX +
   ```
   dry



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to