-
Notifications
You must be signed in to change notification settings - Fork 61
revise BalancerHandler and add MetricSensorHandler #1666
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
revise BalancerHandler and add MetricSensorHandler #1666
Conversation
如果改成預設就將系統內可以找到的 cluster cost + move cost 掛載上去呢?這樣做應該可以簡化邏輯,不過效能面可能要想一下 |
ok
那 |
chia7712
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qoo332001 感謝此功能,有些建議請看一下,另外記得更新文件
|
doc 是不是沒有更新? |
chia7712
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
此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開始計算所需的分數等這隻改的差不多的時候會再補上測試以及文件