You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/31 15:50:26 UTC

[GitHub] [inlong] kuansix opened a new pull request, #6346: [INLONG-6345] add metrics for Doris connector

kuansix opened a new pull request, #6346:
URL: https://github.com/apache/inlong/pull/6346

   ### Prepare a Pull Request
   
   - Title Example: [INLONG-6345] add metrics for Doris connector
   
   - Fixes #6345 
   
   ### Motivation
   
   add metrics
   
   ### Modifications
   
   add metrics
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding 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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] healchow commented on a diff in pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #6346:
URL: https://github.com/apache/inlong/pull/6346#discussion_r1010293450


##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/model/RespContent.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.sort.doris.model;
+
+import lombok.Data;
+import org.apache.doris.shaded.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.doris.shaded.com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.doris.shaded.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.doris.shaded.com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * RespContent copy from {@link org.apache.doris.flink.rest.models.RespContent}
+ **/
+@Data
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RespContent {
+
+    @JsonProperty(value = "TxnId")
+    private int txnId;
+
+    @JsonProperty(value = "Label")
+    private String label;
+
+    @JsonProperty(value = "Status")
+    private String status;
+
+    @JsonProperty(value = "ExistingJobStatus")
+    private String existingJobStatus;
+
+    @JsonProperty(value = "Message")
+    private String message;
+
+    @JsonProperty(value = "NumberTotalRows")
+    private long numberTotalRows;
+
+    @JsonProperty(value = "NumberLoadedRows")
+    private long numberLoadedRows;
+
+    @JsonProperty(value = "NumberFilteredRows")
+    private int numberFilteredRows;
+
+    @JsonProperty(value = "NumberUnselectedRows")
+    private int numberUnselectedRows;
+
+    @JsonProperty(value = "LoadBytes")
+    private long loadBytes;
+
+    @JsonProperty(value = "LoadTimeMs")
+    private int loadTimeMs;
+
+    @JsonProperty(value = "BeginTxnTimeMs")
+    private int beginTxnTimeMs;
+
+    @JsonProperty(value = "StreamLoadPutTimeMs")
+    private int streamLoadPutTimeMs;
+
+    @JsonProperty(value = "ReadDataTimeMs")
+    private int readDataTimeMs;
+
+    @JsonProperty(value = "WriteDataTimeMs")
+    private int writeDataTimeMs;
+
+    @JsonProperty(value = "CommitAndPublishTimeMs")
+    private int commitAndPublishTimeMs;
+
+    @JsonProperty(value = "ErrorURL")
+    private String errorURL;
+
+    @Override
+    public String toString() {
+        ObjectMapper mapper = new ObjectMapper();

Review Comment:
   Suggest using a global instance of `ObjectMapper`.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] kuansix commented on a diff in pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #6346:
URL: https://github.com/apache/inlong/pull/6346#discussion_r1010325220


##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/model/RespContent.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.sort.doris.model;
+
+import lombok.Data;
+import org.apache.doris.shaded.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.doris.shaded.com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.doris.shaded.com.fasterxml.jackson.core.JsonProcessingException;
+import org.apache.doris.shaded.com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * RespContent copy from {@link org.apache.doris.flink.rest.models.RespContent}
+ **/
+@Data
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class RespContent {
+
+    @JsonProperty(value = "TxnId")
+    private int txnId;
+
+    @JsonProperty(value = "Label")
+    private String label;
+
+    @JsonProperty(value = "Status")
+    private String status;
+
+    @JsonProperty(value = "ExistingJobStatus")
+    private String existingJobStatus;
+
+    @JsonProperty(value = "Message")
+    private String message;
+
+    @JsonProperty(value = "NumberTotalRows")
+    private long numberTotalRows;
+
+    @JsonProperty(value = "NumberLoadedRows")
+    private long numberLoadedRows;
+
+    @JsonProperty(value = "NumberFilteredRows")
+    private int numberFilteredRows;
+
+    @JsonProperty(value = "NumberUnselectedRows")
+    private int numberUnselectedRows;
+
+    @JsonProperty(value = "LoadBytes")
+    private long loadBytes;
+
+    @JsonProperty(value = "LoadTimeMs")
+    private int loadTimeMs;
+
+    @JsonProperty(value = "BeginTxnTimeMs")
+    private int beginTxnTimeMs;
+
+    @JsonProperty(value = "StreamLoadPutTimeMs")
+    private int streamLoadPutTimeMs;
+
+    @JsonProperty(value = "ReadDataTimeMs")
+    private int readDataTimeMs;
+
+    @JsonProperty(value = "WriteDataTimeMs")
+    private int writeDataTimeMs;
+
+    @JsonProperty(value = "CommitAndPublishTimeMs")
+    private int commitAndPublishTimeMs;
+
+    @JsonProperty(value = "ErrorURL")
+    private String errorURL;
+
+    @Override
+    public String toString() {
+        ObjectMapper mapper = new ObjectMapper();

Review Comment:
   accept and repair



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] kuansix commented on pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
kuansix commented on PR #6346:
URL: https://github.com/apache/inlong/pull/6346#issuecomment-1298129837

   > Lack of single-table sync metric collect.
   
   single-table sync not supported by inLong product. 
   metric follow product.


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] EMsnap merged pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
EMsnap merged PR #6346:
URL: https://github.com/apache/inlong/pull/6346


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] yunqingmoswu commented on pull request #6346: [INLONG-6345] [Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on PR #6346:
URL: https://github.com/apache/inlong/pull/6346#issuecomment-1297962493

   Lack of single-table sync metric collect.


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] kuansix commented on a diff in pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #6346:
URL: https://github.com/apache/inlong/pull/6346#discussion_r1010159287


##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/table/DorisStreamLoad.java:
##########
@@ -80,7 +81,7 @@ protected boolean isRedirectable(String method) {
         this.httpClient = httpClientBuilder.build();
     }
 
-    public void load(String db, String tbl, String value) throws StreamLoadException {
+    public void load(String db, String tbl, String value, SinkMetricData metricData) throws StreamLoadException {

Review Comment:
   accept and repair



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] kuansix commented on a diff in pull request #6346: [INLONG-6345][Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #6346:
URL: https://github.com/apache/inlong/pull/6346#discussion_r1010159287


##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/table/DorisStreamLoad.java:
##########
@@ -80,7 +81,7 @@ protected boolean isRedirectable(String method) {
         this.httpClient = httpClientBuilder.build();
     }
 
-    public void load(String db, String tbl, String value) throws StreamLoadException {
+    public void load(String db, String tbl, String value, SinkMetricData metricData) throws StreamLoadException {

Review Comment:
   accept



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #6346: [INLONG-6345] [Sort] Add metrics for Doris connector

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #6346:
URL: https://github.com/apache/inlong/pull/6346#discussion_r1010032309


##########
inlong-sort/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/table/DorisStreamLoad.java:
##########
@@ -80,7 +81,7 @@ protected boolean isRedirectable(String method) {
         this.httpClient = httpClientBuilder.build();
     }
 
-    public void load(String db, String tbl, String value) throws StreamLoadException {
+    public void load(String db, String tbl, String value, SinkMetricData metricData) throws StreamLoadException {

Review Comment:
   It is recommended to modify the method return instead of modifying the input parameters to support metric collection.



-- 
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: commits-unsubscribe@inlong.apache.org

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