morningman commented on code in PR #14100:
URL: https://github.com/apache/doris/pull/14100#discussion_r1018055536


##########
fe_plugins/auditloader/src/main/java/org/apache/doris/plugin/audit/AuditLoaderPlugin.java:
##########
@@ -146,28 +150,35 @@ public void exec(AuditEvent event) {
     }
 
     private void assembleAudit(AuditEvent event) {
-        auditBuffer.append(event.queryId).append("\t");
-        auditBuffer.append(longToTimeString(event.timestamp)).append("\t");
-        auditBuffer.append(event.clientIp).append("\t");
-        auditBuffer.append(event.user).append("\t");
-        auditBuffer.append(event.db).append("\t");
-        auditBuffer.append(event.state).append("\t");
-        auditBuffer.append(event.queryTime).append("\t");
-        auditBuffer.append(event.scanBytes).append("\t");
-        auditBuffer.append(event.scanRows).append("\t");
-        auditBuffer.append(event.returnRows).append("\t");
-        auditBuffer.append(event.stmtId).append("\t");
-        auditBuffer.append(event.isQuery ? 1 : 0).append("\t");
-        auditBuffer.append(event.feIp).append("\t");
-        auditBuffer.append(event.cpuTimeMs).append("\t");
-        auditBuffer.append(event.sqlHash).append("\t");
-        auditBuffer.append(event.sqlDigest).append("\t");
-        auditBuffer.append(event.peakMemoryBytes).append("\t");
+        if (event.queryTime > Config.qe_slow_log_ms) {

Review Comment:
   `qe_slow_log_ms` should be a config of plugin itself.
   If you use `Config.qe_slow_log_ms`, than it is a fix value that can not be 
changed.



##########
fe_plugins/auditloader/src/main/java/org/apache/doris/plugin/audit/DorisStreamLoader.java:
##########
@@ -123,7 +127,13 @@ public LoadResponse loadBatch(StringBuilder sb) {
         HttpURLConnection beConn = null;
         try {
             // build request and send to fe
-            feConn = getConnection(loadUrlStr, label);
+            if (slowLog) {
+                label = "slow" + label;
+                feConn = getConnection(slowLogLoadUrlStr, label);
+            } else {
+                label = "audit" + label;

Review Comment:
   ```suggestion
                   label = "audit_" + label;
   ```



##########
fe_plugins/auditloader/src/main/java/org/apache/doris/plugin/audit/DorisStreamLoader.java:
##########
@@ -123,7 +127,13 @@ public LoadResponse loadBatch(StringBuilder sb) {
         HttpURLConnection beConn = null;
         try {
             // build request and send to fe
-            feConn = getConnection(loadUrlStr, label);
+            if (slowLog) {
+                label = "slow" + label;

Review Comment:
   ```suggestion
                   label = "slow_" + label;
   ```



-- 
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-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to