Skip to content
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

可以支持自定义设置RT吗? #548

Open
yejialiango opened this issue Sep 13, 2023 · 2 comments
Open

可以支持自定义设置RT吗? #548

yejialiango opened this issue Sep 13, 2023 · 2 comments

Comments

@yejialiango
Copy link

https://github.com/alibaba/sentinel-golang/blob/master/core/stat/stat_slot.go#L68

这个位置是直接设置了rt := util.CurrentTimeMillis() - ctx.StartTime(),调用方就算在前面通过 ctx.PutRT也没法生效,是不是应该通过rt := ctx.RT()获取,如果已经设置过了,就不用覆盖会好一些?

@sczyh30
Copy link
Member

sczyh30 commented Sep 14, 2023

咱们这边需要特殊设置的场景是怎样的呢,可否帮忙介绍一下

@yejialiango
Copy link
Author

我这边用的是 mosn 框架作代理网关,按照mosn的流程,在响应结束后我们只能在 Filter 的 OnDestroy 流程执行 entry.Exit()退出,但是实际上响应是在 OnDestroy之前的,如果依赖entry.Exit()内部设置的RT,实际上会有偏差,下面草图是我们的场景:
whiteboard_exported_image (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants