revise BalancerHandler and add MetricSensorHandler#1666
Merged
qoo332001 merged 7 commits intoopensource4you:mainfrom Apr 27, 2023
Merged
revise BalancerHandler and add MetricSensorHandler#1666qoo332001 merged 7 commits intoopensource4you:mainfrom
qoo332001 merged 7 commits intoopensource4you:mainfrom
Conversation
Contributor
如果改成預設就將系統內可以找到的 cluster cost + move cost 掛載上去呢?這樣做應該可以簡化邏輯,不過效能面可能要想一下 |
Collaborator
Author
ok
那 |
chia7712
reviewed
Apr 21, 2023
Contributor
chia7712
left a comment
There was a problem hiding this comment.
@qoo332001 感謝此功能,有些建議請看一下,另外記得更新文件
Contributor
|
doc 是不是沒有更新? |
chia7712
reviewed
Apr 24, 2023
chia7712
reviewed
Apr 24, 2023
chia7712
reviewed
Apr 24, 2023
chia7712
reviewed
Apr 24, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
此PR:
WebService上修改MetricsSensor的設定方法MetricsSensor的邏輯移出BalancerHandlerMetricsSensor的邏輯改放到MetricSensorHandler(原為BeanHandler)的PostRequest中需要這隻PR的原因:
BalancerHandler沒辦法長時間的收集metrics(在使用者執行PostRequest時才會收集metrics),這會導致一些需要長時間統計metrics的CostFunction(例如 [COST] addMigrateTimeCost#1665)無法收集足夠的metrics來計算分數WebService修改成平常就可以收集metrics,以及可以隨時選擇感興趣的指標(選擇CostFunction),如此變可以拉長指標的蒐集時間,並用長時間收集的metrics來計算CostFunction修改前後差異:
BalancerHandler的流程如下:WebService,此時MetricStore已經build,但因為沒有註冊MetricsSensor,因此不會撈取任何metricsMetricsSensor並開始撈取metricsCostFunction開始計算所需的分數MetricSensorHandler與BalancerHandler的流程如下:WebService,且同時透過送出MetricSensorHandler的PostRequest來選擇未來可能會想要做負載平衡的CostFunction,此時會同時註冊這些CostFunction的MetricsSensor並開始撈取metricsBalancerHandler的PostRequest,可以使用這些統計一段時間的metrics來做負載平衡CostFunction開始計算所需的分數等這隻改的差不多的時候會再補上測試以及文件