shishkovilja commented on code in PR #11612:
URL: https://github.com/apache/ignite/pull/11612#discussion_r1823183000


##########
docs/_docs/persistence/change-data-capture.adoc:
##########
@@ -125,6 +125,8 @@ The following metrics are provided by the application 
(additional metrics can be
 | BinaryMetaDir | Binary meta-directory the application reads data from.
 | MarshallerDir | Marshaller directory the application reads data from.
 | CdcDir | The CDC directory the application reads data from.
+| EventsConsumptionTime | Time for which this CDC client processed the WAL 
segment events, in nanoseconds.

Review Comment:
   ```suggestion
   | EventsConsumptionTime | Time of WAL segment events processing by a CDC 
consumer, in nanoseconds.
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java:
##########
@@ -616,6 +652,18 @@ private void 
consumeSegmentActively(IgniteWalIteratorFactory.IteratorParametersB
         catch (IgniteCheckedException | IOException e) {
             throw new IgniteException(e);
         }
+        finally {
+            updateWalProcessingMetrics(System.nanoTime() - start);
+        }
+    }
+
+    /**
+     * Updates consumer event coonsumption metrics.
+     * @param duration - Operation durtion.
+     */
+    private void updateWalProcessingMetrics(long duration) {

Review Comment:
   This method consisting of two lines is used only once, why should we add it?



##########
modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java:
##########
@@ -183,6 +185,29 @@ public class CdcMain implements Runnable {
     private static final IgniteBiPredicate<WALRecord.RecordType, WALPointer> 
ACTIVE_RECS =
         (type, ptr) -> type == DATA_RECORD_V2 || type == CDC_DATA_RECORD;
 
+    /** Histogram buckets for duration wal processing in nanoseconds. */
+    public static final long[] HISTOGRAM_BUCKETS = new long[] {
+        NANOSECONDS.convert(1, MILLISECONDS),
+        NANOSECONDS.convert(10, MILLISECONDS),
+        NANOSECONDS.convert(100, MILLISECONDS),
+        NANOSECONDS.convert(250, MILLISECONDS),
+        NANOSECONDS.convert(1000, MILLISECONDS)
+    };
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME = 
"EventsConsumptionTime";
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME_DESC =
+        "Time for which this CDC client processed the WAL segment events, in 
nanoseconds.";
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME_TOTAL = 
"EventsConsumptionTimeTotal";
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME_TOTAL_DESC =

Review Comment:
   Fix it in the same way as the documentation.



##########
modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java:
##########
@@ -204,6 +229,12 @@ public class CdcMain implements Runnable {
     /** Time of last segment consumption. */
     private AtomicLongMetric lastSegmentConsumptionTs;
 
+    /** Metric shows duration of the last WAL segment events consumption. */
+    private HistogramMetricImpl eventsConsumptionTime;
+
+    /** Metric shows the total duration of WAL segment events consumption. */

Review Comment:
   Fix it in the same way as the documentation.



##########
modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java:
##########
@@ -183,6 +185,29 @@ public class CdcMain implements Runnable {
     private static final IgniteBiPredicate<WALRecord.RecordType, WALPointer> 
ACTIVE_RECS =
         (type, ptr) -> type == DATA_RECORD_V2 || type == CDC_DATA_RECORD;
 
+    /** Histogram buckets for duration wal processing in nanoseconds. */
+    public static final long[] HISTOGRAM_BUCKETS = new long[] {
+        NANOSECONDS.convert(1, MILLISECONDS),
+        NANOSECONDS.convert(10, MILLISECONDS),
+        NANOSECONDS.convert(100, MILLISECONDS),
+        NANOSECONDS.convert(250, MILLISECONDS),
+        NANOSECONDS.convert(1000, MILLISECONDS)
+    };
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME = 
"EventsConsumptionTime";
+
+    /** */
+    public static final String EVENTS_CONSUMPTION_TIME_DESC =

Review Comment:
   Fix it in the same way as the documentation.



##########
docs/_docs/persistence/change-data-capture.adoc:
##########
@@ -125,6 +125,8 @@ The following metrics are provided by the application 
(additional metrics can be
 | BinaryMetaDir | Binary meta-directory the application reads data from.
 | MarshallerDir | Marshaller directory the application reads data from.
 | CdcDir | The CDC directory the application reads data from.
+| EventsConsumptionTime | Time for which this CDC client processed the WAL 
segment events, in nanoseconds.
+| EventsConsumptionTimeTotal | The total time for which this CDC client 
processed the WAL segments events, in nanoseconds.

Review Comment:
   ```suggestion
   | EventsConsumptionTimeTotal | Total time of events processing by a CDC 
consumer, in nanoseconds.
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/cdc/CdcMain.java:
##########
@@ -204,6 +229,12 @@ public class CdcMain implements Runnable {
     /** Time of last segment consumption. */
     private AtomicLongMetric lastSegmentConsumptionTs;
 
+    /** Metric shows duration of the last WAL segment events consumption. */

Review Comment:
   Fix it in the same way as the documentation.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to