WANG 5 years ago
parent
commit
568c4d9a37

+ 2 - 0
src/main/java/cn/com/qmth/examcloud/web/actuator/ApiStatusEndpoint.java

@@ -125,9 +125,11 @@ public class ApiStatusEndpoint {
 				MeterInfo apiErrMeterInfo = apiErrMeterInfoMap.get(mapping);
 				if (null == apiErrMeterInfo) {
 					apiStatusInfo.setErrorCount(0L);
+					apiStatusInfo.setErrorMeanRate(0L);
 					apiStatusInfo.setErrorPercent(0D);
 				} else {
 					apiStatusInfo.setErrorCount(apiErrMeterInfo.getCount());
+					apiStatusInfo.setErrorMeanRate(apiErrMeterInfo.getMeanRate());
 					apiStatusInfo.setErrorPercent(
 							getPercent(apiErrMeterInfo.getMeanRate(), cur.getMeanRate()));
 				}

+ 10 - 0
src/main/java/cn/com/qmth/examcloud/web/actuator/ApiStatusInfo.java

@@ -34,6 +34,8 @@ public class ApiStatusInfo {
 
 	private Long errorCount;
 
+	private double errorMeanRate;
+
 	private double errorPercent;
 
 	public String getMapping() {
@@ -164,6 +166,14 @@ public class ApiStatusInfo {
 		this.errorCount = errorCount;
 	}
 
+	public double getErrorMeanRate() {
+		return errorMeanRate;
+	}
+
+	public void setErrorMeanRate(double errorMeanRate) {
+		this.errorMeanRate = errorMeanRate;
+	}
+
 	public double getErrorPercent() {
 		return errorPercent;
 	}

+ 1 - 1
src/main/resources/api-status.html

@@ -67,7 +67,7 @@ td {
 			<td>${cur.p95?string("#.##")}</td>
 			<td>${cur.p98?string("#.##")}</td>
 			<td>${cur.p99?string("#.##")}</td>
-			<td>${cur.errorCount?c}</td>
+			<td>${cur.errorCount?c} (${cur.errorMeanRate})</td>
 			<td>${cur.errorPercent?string.percent}</td>
 		</tr>
 		</#list>