Browse Source

Update designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java

bugfix/11.0
Bryant 3 years ago
parent
commit
6e0d9710fb
  1. 12
      designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java

12
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.general.GeneralUtils;
import com.fr.intelli.measure.Estimator; import com.fr.intelli.measure.Estimator;
import com.fr.intelli.metrics.Compute; import com.fr.intelli.metrics.Compute;
import com.fr.intelli.metrics.MessageRecorderFactory;
import com.fr.intelli.metrics.SupervisoryConfig; import com.fr.intelli.metrics.SupervisoryConfig;
import com.fr.intelli.record.Measurable; import com.fr.intelli.record.Measurable;
import com.fr.intelli.record.MeasureObject; import com.fr.intelli.record.MeasureObject;
import com.fr.intelli.record.MeasureUnit; import com.fr.intelli.record.MeasureUnit;
import com.fr.intelli.record.MetricRegistry;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.measure.DBMeterFactory; import com.fr.measure.DBMeterFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -80,18 +80,16 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice {
List<Object> newArgs = new ArrayList<>(Arrays.asList(args)); List<Object> newArgs = new ArrayList<>(Arrays.asList(args));
newArgs.add(id); newArgs.add(id);
recordSQLDetail(id); recordSQLDetail(id);
if (measurable instanceof Estimator) {
measurable.asyncDurable(measureObject, newArgs.toArray());
} else {
Object message = null; Object message = null;
try { try {
message = measurable.durableEntity(measureObject, newArgs.toArray()); message = measurable.durableEntity(measureObject, newArgs.toArray());
} catch (Throwable throwable) { } catch (Throwable throwable) {
FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable);
} }
if (message != null) { if (measurable instanceof Estimator) {
MetricRegistry.getMetric().submit(message); MessageRecorderFactory.getInstance().asyncSubmit(message);
} } else {
MessageRecorderFactory.getInstance().syncSubmit(message);
} }
} }
} catch (Exception ignore) { } catch (Exception ignore) {

Loading…
Cancel
Save