Browse Source

Pull request #8202: REPORT-67131 之前暂存埋点的逻辑没人用了,去掉

Merge in DESIGN/design from ~BRYANT/design:feature/x to feature/x

* commit '57330e0a15f38a306a1e2ed2efac0a38c7409db7':
  REPORT-67131 之前暂存埋点的逻辑没人用了,去掉
feature/x
Bryant 3 years ago
parent
commit
64087b44c3
  1. 15
      designer-base/src/main/java/com/fr/design/record/analyzer/advice/MonitorAdvice.java

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

@ -9,6 +9,7 @@ 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;
import com.fr.stable.StringUtils;
@ -79,25 +80,17 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice {
List<Object> newArgs = new ArrayList<>(Arrays.asList(args));
newArgs.add(id);
recordSQLDetail(id);
String sessionID = null;
SessionProvider provider = SessionLocalManager.getSession();
if (provider != null) {
sessionID = provider.getSessionID();
}
if (measurable instanceof Estimator) {
measurable.asyncDurable(measureObject, newArgs.toArray());
} else {
Object message;
Object message = null;
try {
message = measurable.durableEntity(measureObject, newArgs.toArray());
} catch (Throwable throwable) {
//埋点生成失败,降级逻辑
message = measurable.fallBackEntity();
FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable);
}
if (StringUtils.isEmpty(sessionID)) {
if (message != null) {
MetricRegistry.getMetric().submit(message);
} else {
MetricRegistry.getMetric().submitAccumulativeData(sessionID, message);
}
}
}

Loading…
Cancel
Save