diff --git a/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java b/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java index a459d0841d..68f8c8508f 100644 --- a/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java +++ b/designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java @@ -4,11 +4,11 @@ import com.fr.design.record.analyzer.DesignerAnalyzerAdvice; import com.fr.general.GeneralUtils; import com.fr.intelli.measure.Estimator; import com.fr.intelli.metrics.Compute; +import com.fr.intelli.metrics.MessageRecorderFactory; import com.fr.intelli.metrics.SupervisoryConfig; import com.fr.intelli.record.Measurable; import com.fr.intelli.record.MeasureObject; import com.fr.intelli.record.MeasureUnit; -import com.fr.intelli.record.MetricRegistry; import com.fr.log.FineLoggerFactory; import com.fr.measure.DBMeterFactory; import com.fr.stable.ArrayUtils; @@ -80,18 +80,16 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { List newArgs = new ArrayList<>(Arrays.asList(args)); newArgs.add(id); recordSQLDetail(id); + Object message = null; + try { + message = measurable.durableEntity(measureObject, newArgs.toArray()); + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); + } if (measurable instanceof Estimator) { - measurable.asyncDurable(measureObject, newArgs.toArray()); + MessageRecorderFactory.getInstance().asyncSubmit(message); } else { - Object message = null; - try { - message = measurable.durableEntity(measureObject, newArgs.toArray()); - } catch (Throwable throwable) { - FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); - } - if (message != null) { - MetricRegistry.getMetric().submit(message); - } + MessageRecorderFactory.getInstance().syncSubmit(message); } } } catch (Exception ignore) {