From 6e0d9710fbe9f808af7773eb1b9fac10048160df Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 11 Apr 2022 18:02:11 +0800 Subject: [PATCH] Update designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java --- .../record/analyzer/advice/MonitorAdvice.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) 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 a459d0841..68f8c8508 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) {