|
|
@ -105,7 +105,7 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String getErrorContent(Exception e) { |
|
|
|
public static String getErrorContent(Exception e) { |
|
|
|
int errorCode = GeneralUtils.objectToNumber( |
|
|
|
int errorCode = GeneralUtils.objectToNumber( |
|
|
|
extractCodeFromString(e.getMessage()) |
|
|
|
extractCodeFromString(e.getMessage()) |
|
|
|
).intValue(); |
|
|
|
).intValue(); |
|
|
@ -113,7 +113,7 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { |
|
|
|
return e.getClass().getName() + ":" + (errorCode >= MIN_ERROR_CODE ? errorCode : StringUtils.EMPTY); |
|
|
|
return e.getClass().getName() + ":" + (errorCode >= MIN_ERROR_CODE ? errorCode : StringUtils.EMPTY); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String extractCodeFromString(String errorMsg) { |
|
|
|
public static String extractCodeFromString(String errorMsg) { |
|
|
|
Matcher m = P.matcher(errorMsg); |
|
|
|
Matcher m = P.matcher(errorMsg); |
|
|
|
if (m.find()) { |
|
|
|
if (m.find()) { |
|
|
|
return m.group(); |
|
|
|
return m.group(); |
|
|
@ -121,25 +121,25 @@ public class MonitorAdvice implements DesignerAnalyzerAdvice { |
|
|
|
return StringUtils.EMPTY; |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void recordSQLDetail(String uuid) { |
|
|
|
public static void recordSQLDetail(String uuid) { |
|
|
|
DBMeterFactory.getMeter().submit(uuid); |
|
|
|
DBMeterFactory.getMeter().submit(uuid); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void recordSQL(Compute once, MeasureObject measureObject) { |
|
|
|
public static void recordSQL(Compute once, MeasureObject measureObject) { |
|
|
|
if (SupervisoryConfig.getInstance().isEnableMeasureSql() && once.computeSql()) { |
|
|
|
if (SupervisoryConfig.getInstance().isEnableMeasureSql() && once.computeSql()) { |
|
|
|
measureObject.sqlTime(SessionLocalManager.getSqlTime()); |
|
|
|
measureObject.sqlTime(SessionLocalManager.getSqlTime()); |
|
|
|
measureObject.sql(SessionLocalManager.getSql()); |
|
|
|
measureObject.sql(SessionLocalManager.getSql()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void recordMemory(Compute once, Measurable measurable, MeasureObject measureObject) { |
|
|
|
public static void recordMemory(Compute once, Measurable measurable, MeasureObject measureObject) { |
|
|
|
if (SupervisoryConfig.getInstance().isEnableMeasureMemory() && once.computeMemory()) { |
|
|
|
if (SupervisoryConfig.getInstance().isEnableMeasureMemory() && once.computeMemory()) { |
|
|
|
MeasureUnit unit = measurable.measureUnit(); |
|
|
|
MeasureUnit unit = measurable.measureUnit(); |
|
|
|
measureObject.memory(unit.measureMemory()); |
|
|
|
measureObject.memory(unit.measureMemory()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean findSessionAnnotation(Method method, Object[] args) { |
|
|
|
public static boolean findSessionAnnotation(Method method, Object[] args) { |
|
|
|
Annotation[][] all = method.getParameterAnnotations(); |
|
|
|
Annotation[][] all = method.getParameterAnnotations(); |
|
|
|
int len = ArrayUtils.getLength(args); |
|
|
|
int len = ArrayUtils.getLength(args); |
|
|
|
for (int i = 0; i < len; i++) { |
|
|
|
for (int i = 0; i < len; i++) { |
|
|
|