-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[RFC] 统计 egg 加载过程的各步骤的耗时 #1898
Comments
可以考虑用 metrix 的思路来做 |
cc: @popomore |
很早前有一个相关的:#421 |
|
然后可以设置一个性能基准,保证后续都控制在基准之下。 现在发现有些复杂的应用,启动加载的东西太多,可能导致超时 |
我理了下可能需要两个插件:
另外是否有必要统计 koa 的一些关键操作和 middleware 的操作。 |
@ImHype 可以直接开干的,实践后分享出来 |
如果只是加载过程不需要 metrix,不过到是可以把 loader 的数据给 metrix 来显示。 |
@popomore metrics 主要还是统计系统运行时的状态,加载过程确实不太需要 |
@MiYogurt 做了啥... 你开下 loader 的 DEBUG 看看耗时在哪吧,是不是 beforeStart 太多了? |
在 egg-core 增加 app.timing API,主要给核心使用,但应用和插件也可以使用。 APIconst id = app.timing.start('name');
sleep(1000);
app.timing.end(id); 生成的数据 [
{ "name": "name", "start": 1525542573797, "end": 1525542574797, "duration": 1000 }
] egg-core
egg
egg-development提供一个可视化页面,可以展现 trace 信息,如 http://jsfiddle.net/popomore/jbcggas6/12/embedded/result/ 不过有个问题是,生产环境排查无法使用,这时可以使用工具将数据上报,单独平台做可视化。 |
@popomore trace 日志收集吧,其实比较关心的是 koaContext 及后续 kcurl 的调用情况,不知道你们内部有做这块工作吗 |
这个后面会做 metrics 插件,和这个需求不一样。 |
opentracing 也会做 #39 |
@popomore 文档也加下吧?
|
The text was updated successfully, but these errors were encountered: