WANG 5 ani în urmă
părinte
comite
4474283492

+ 4 - 4
src/main/java/cn/com/qmth/examcloud/web/interceptor/ApiStatisticInterceptor.java

@@ -63,15 +63,15 @@ public class ApiStatisticInterceptor implements HandlerInterceptor {
 		Boolean hasException = (Boolean) request
 				.getAttribute(HttpServletRequestAttribute.$_EXCEPTION_HAPPENED.name());
 
-		Meter apiMeter = MetricRegistryHolder.getDefalut()
-				.meter(MetricRegistry.name(MetricNames.API_METER.name(), apiInfo.getMapping()));
-		apiMeter.mark();
-
 		if (null != hasException && hasException) {
 			Meter apiErrorMeter = MetricRegistryHolder.getDefalut().meter(
 					MetricRegistry.name(MetricNames.API_ERROR_METER.name(), apiInfo.getMapping()));
 			apiErrorMeter.mark();
 		}
 
+		Meter apiMeter = MetricRegistryHolder.getDefalut()
+				.meter(MetricRegistry.name(MetricNames.API_METER.name(), apiInfo.getMapping()));
+		apiMeter.mark();
+
 	}
 }