yswdqz commented on code in PR #9575:
URL: https://github.com/apache/skywalking/pull/9575#discussion_r967022249


##########
oap-server/analyzer/log-analyzer/src/main/java/org/apache/skywalking/oap/log/analyzer/dsl/spec/extractor/ExtractorSpec.java:
##########
@@ -215,6 +244,50 @@ public void metrics(@DelegatesTo(SampleBuilder.class) 
final Closure<?> cl) {
         }
     }
 
+    @SuppressWarnings("unused")
+    public void slowSql(@DelegatesTo(SlowSqlSpec.class) final Closure<?> cl) {
+        if (BINDING.get().shouldAbort()) {
+            return;
+        }
+        LogData.Builder log = BINDING.get().log();
+        if (log.getLayer() == null
+                || log.getService() == null
+                || log.getTimestamp() < 1) {
+            LOGGER.warn("SlowSql extracts failed, maybe something is not 
configured.");
+            return;
+        }
+        DatabaseSlowStatementBuilder builder = new 
DatabaseSlowStatementBuilder(namingControl);
+        builder.setLayer(Layer.nameOf(log.getLayer()));
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        String timeBucket = sdf.format(new Date(log.getTimestamp()));

Review Comment:
   I have fixed it, and I find a bug with abort{}. I will commit them together.



-- 
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