8000 BeanLoadCost hierarchical display by alaneuler · Pull Request #731 · sofastack/sofa-boot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BeanLoadCost hierarchical display #731

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

Merged
merged 4 commits into from
Oct 26, 2020
Merged

BeanLoadCost hierarchical display #731

merged 4 commits into from
Oct 26, 2020

Conversation

alaneuler
Copy link
Contributor

fix: #730

Copy link
Contributor
@HzjNeverStop HzjNeverStop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

child中耗时小于beanloastcost的是否应该把它从树里remove掉,不然日志量对比原来会增大很多

@alaneuler
Copy link
Contributor Author

beanloastcost

有考虑过,但是总的 bean 耗时的确超过了阈值,这样是不是有助于排查问题

@HzjNeverStop
Copy link
Contributor

beanloastcost

有考虑过,但是总的 bean 耗时的确超过了阈值,这样是不是有助于排查问题

考虑一个场景,如果一个 bean 依赖了很多 bean 导致超时,但是被依赖的这些 bean 均未超时,是否也需要展示 bean 的依赖树
回到这个日志输出的目的,应该是为了定位到 某个"自身" 初始化耗时较长的 bean,能否通过父子关系计算得到每一层 bean 自身的耗时信息,不从 root 开始打印, 而是只打印 “自身” 耗时较长的 bean

@alaneuler
Copy link
Contributor Author

beanloastcost

有考虑过,但是总的 bean 耗时的确超过了阈值,这样是不是有助于排查问题

考虑一个场景,如果一个 bean 依赖了很多 bean 导致超时,但是被依赖的这些 bean 均未超时,是否也需要展示 bean 的依赖树
回到这个日志输出的目的,应该是为了定位到 某个"自身" 初始化耗时较长的 bean,能否通过父子关系计算得到每一层 bean 自身的耗时信息,不从 root 开始打印, 而是只打印 “自身” 耗时较长的 bean

是的,但是如果是方便梳理出来的依赖,那是 OK;如果是类似 getObjectType 返回 null 的异常情况,是不是就有助于发现问题了

@HzjNeverStop
Copy link
Contributor

beanloastcost

有考虑过,但是总的 bean 耗时的确超过了阈值,这样是不是有助于排查问题

考虑一个场景,如果一个 bean 依赖了很多 bean 导致超时,但是被依赖的这些 bean 均未超时,是否也需要展示 bean 的依赖树
回到这个日志输出的目的,应该是为了定位到 某个"自身" 初始化耗时较长的 bean,能否通过父子关系计算得到每一层 bean 自身的耗时信息,不从 root 开始打印, 而是只打印 “自身” 耗时较长的 bean

是的,但是如果是方便梳理出来的依赖,那是 OK;如果是类似 getObjectType 返回 null 的异常情况,是不是就有助于发现问题了

方案没问题哈 我只是觉得既然有了这个数据 可以把能力分开 一个是找到耗时长的bean(可以通过root耗时减去child耗时得到bean自身耗时) 一个是查看bean刷新顺序 前者是强需求(很多业务会看) 后者基本只有查问题用 现在合到一起 如果我只想看前者,会不会多了很多无用信息,毕竟此时beancost阈值这个实际是无效了

@alaneuler
Copy link
Contributor Author

但是我认为,虽然 beancost 阈值无效了,但是很可能包含异常情况(类比于 getObjectType 返回 null)

@HzjNeverStop
Copy link
Contributor

LGTM

@alaneuler alaneuler merged commit 4adffca into sofastack:master Oct 26, 2020
@alaneuler alaneuler added this to the 3.5.0 milestone Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BeanLoadCost hierarchical display
2 participants
0