wu-sheng commented on code in PR #9575:
URL: https://github.com/apache/skywalking/pull/9575#discussion_r967013310
##########
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");
Review Comment:
Format instance should be static, as this is low performance.
--
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]