Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
极客时间账号:13571883375
实现原理:
根据老师提供的提示信息,动态代理对应的Service实现,核心代码:
写了几个调用方法去触发,通过判断对应的方法名来做堆栈信息的输出。
不足之处:
1.可能兼容性上不是特别完善(期待老师的标准答案)。
2.没有按照耗电监控的规则去做一些业务处理。
心得体会:
1.本身并不复杂,只是为了找到hook点,看了对应的Service源码耗费了一定时间,对于它们的工作流程有了更深的认识。
2.平时也很少使用动态代理,这回查漏补缺,一次用了个爽。