-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate with sofa-lookout for support metrics 2.0. #127
Conversation
Adjust the order of events and record elapsed time when async invoke.…
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
============================================
+ Coverage 65.74% 66.44% +0.69%
- Complexity 685 756 +71
============================================
Files 272 280 +8
Lines 11626 11904 +278
Branches 1961 1981 +20
============================================
+ Hits 7644 7910 +266
+ Misses 3015 3006 -9
- Partials 967 988 +21
Continue to review full report at Codecov.
|
|
||
@Override | ||
public boolean needLoad() { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该加上判断,存在 Lookout的类才加载。
static { | ||
LookoutSubscriber.setLookoutCollectDisable(true); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个逻辑是?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
让之前的rpc调用不收集metrics信息,避免在lookout的用例初始化lookout的registry之前对registry进行了初始化。如果提前初始化了就会导致registry是一个noop。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段逻辑挪到 LookoutSubscriber 里去吧。 If(RpcRunningState.isUnitTestMode())
/** | ||
* | ||
* @author <a href="mailto:lw111072@antfin.com">LiWei.Liengen</a> | ||
* @version $Id: BoltServerStartedEvent.java, v 0.1 2018年04月24日 下午10:57 LiWei.Liengen Exp $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你自己的名字拼音是不是错了?
@version
这行删掉吧。
<artifactId>lookout-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<build></build>
从别的 module里复制过来。
|
||
private final RpcLookoutId rpcLookoutId = new RpcLookoutId(); | ||
|
||
private static final String EMPTY_STRING = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个在 StringUtils 里已经有了
* @author <a href="mailto:lw111072@antfin.com">LiWei.Liangen</a> | ||
* @version $Id: LookoutService.java, v 0.1 2018年05月10日 下午10:56 LiWei.Liangen Exp $ | ||
*/ | ||
public interface LookoutService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个用例依赖第三方服务端吗?如果不依赖,挪到 test-integration 模块下去。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个用例依赖zk
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>${dependency.test.skip}</skipTests> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${skipTests}
static { | ||
LookoutSubscriber.setLookoutCollectDisable(true); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段逻辑挪到 LookoutSubscriber 里去吧。 If(RpcRunningState.isUnitTestMode())
public void uninstall() { | ||
if (subscriber != null) { | ||
EventBus.unRegister(ClientEndInvokeEvent.class, subscriber); | ||
EventBus.unRegister(ClientAsyncReceiveEvent.class, subscriber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClientAsyncReceiveEvent
这个事件不需要了吧。
public void install() { | ||
subscriber = new LookoutSubscriber(); | ||
EventBus.register(ClientEndInvokeEvent.class, subscriber); | ||
EventBus.register(ClientAsyncReceiveEvent.class, subscriber); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ClientAsyncReceiveEvent
这个事件不需要了吧。
Motivation:
Add the lookout module, report the information to lookout.
Modification:
Add lookout module.
A LookoutSubscriber was declared to monitor bolt thread pool status and call information.
Add lookout-api dependency.
Result:
If the "lookout. collect. disable" is false. The call information will be collected and reported to lookout.