xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147541
 
 

 ##########
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/event/IsolationServerEvent.java
 ##########
 @@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.loadbalance.event;
+
+import java.util.HashMap;
+
+import org.apache.servicecomb.foundation.common.event.AlarmEvent;
+
+public class IsolationServerEvent extends AlarmEvent {
+
+  private String microserviceName;
+
+  //当前实例总请求数
+  private long currentTotalRequest;
+
+  //当前实例连续出错次数
+  private int currentCountinuousFailureCount;
+
+  //当前实例出错百分比
+  private double currentErrorPercentage;
+
+  private long enableRequestThreshold;
+
+  private int continuousFailureThreshold;
+
+  private int errorThresholdPercentage;
+
+  private long singleTestTime;
+
+  public IsolationServerEvent(String microserviceName, long totalRequest, int 
currentCountinuousFailureCount,
+      double currentErrorPercentage, int continuousFailureThreshold,
+      int errorThresholdPercentage, long enableRequestThreshold, long 
singleTestTime, Type type) {
+    super(type);
+    HashMap<String, Object> msg = new HashMap<>();
+    this.microserviceName = microserviceName;
+    this.currentTotalRequest = totalRequest;
+    this.currentCountinuousFailureCount = currentCountinuousFailureCount;
+    this.currentErrorPercentage = currentErrorPercentage;
+    this.enableRequestThreshold = enableRequestThreshold;
+    this.continuousFailureThreshold = continuousFailureThreshold;
+    this.errorThresholdPercentage = errorThresholdPercentage;
+    this.singleTestTime = singleTestTime;
+    msg.put("microserviceName", this.microserviceName);
 
 Review comment:
   done,Removed map

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to