[ 
https://issues.apache.org/jira/browse/SCB-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449402#comment-16449402
 ] 

ASF GitHub Bot commented on SCB-506:
------------------------------------

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

 ##########
 File path: 
handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/BizkeeperHandler.java
 ##########
 @@ -72,8 +76,14 @@ public BizkeeperHandler(String groupname) {
   @Override
   public void handle(Invocation invocation, AsyncResponse asyncResp) {
     HystrixObservable<Response> command = 
delegate.createBizkeeperCommand(invocation);
-
     Observable<Response> observable = command.toObservable();
+    HystrixCircuitBreaker circuitBreaker =
+        
HystrixCircuitBreaker.Factory.getInstance(CommandKey.toHystrixCommandKey(groupname,
 invocation));
+    if (circuitBreaker != null && circuitBreaker.isOpen()) {
+      EventManager.post(new CircutBreakerEvent(invocation, this.groupname, 
Type.OPEN));
+    }else {
+      EventManager.post(new CircutBreakerEvent(invocation, this.groupname, 
Type.CLOSE));
 
 Review comment:
   We need only send event when last time is OPEN and turn to be CLOSED. Can't 
send for each invocation. 

----------------------------------------------------------------
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


> 服务治理相关的需要事件上报
> -------------
>
>                 Key: SCB-506
>                 URL: https://issues.apache.org/jira/browse/SCB-506
>             Project: Apache ServiceComb
>          Issue Type: Task
>          Components: Java-Chassis
>            Reporter: xuyiyun
>            Assignee: xuyiyun
>            Priority: Major
>
> 如果发生服务降级 实例隔离 熔断等操作,业务监控系统需要能获取到对应的通知,方便集成



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to