-
Notifications
You must be signed in to change notification settings - Fork 62
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
[COMMON] Implementation of MetricSeriesBuilder
#1412
[COMMON] Implementation of MetricSeriesBuilder
#1412
Conversation
common/src/test/java/org/astraea/common/cost/NetworkCostTest.java
Outdated
Show resolved
Hide resolved
@chia7712 能夠幫我看一下概念嗎,如果沒問題我再推具體實作和測試 |
這個概念是不錯,不過在實作上比較難想像,畢竟我們預期 metrics 有非常多種和組合,甚至有一些是 cost 內部自己的統計結果。另外請問預期是哪一個元件要負責去“產生這個模擬的 ClusterBean"? 如果不是 cost 自己去產生的話,那外部物件可能也無法理解 cost 自行組合的 metrics |
這個東西不會直接被 Astraea 的 End User 使用,他不會屬於任何對外的元件, |
所以主要是測試用途嗎?如果是的話,有一個方便建構ClusterBean的工具就很不錯 +1 |
是的,主要是測試用,我後面會補上具體實作,感謝 |
common/src/main/java/org/astraea/common/metrics/MetricSeriesBuilder.java
Outdated
Show resolved
Hide resolved
MetricSeriesBuilder
MetricSeriesBuilder
common/src/main/java/org/astraea/common/metrics/MetricSeriesBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/org/astraea/common/metrics/MetricSeriesBuilder.java
Outdated
Show resolved
Hide resolved
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,接下來就看各個 cost 用起來如何
這個 PR 提出一個簡易的手法來對產生某個
ClusterInfo
的假ClusterBean
,且這個假的ClusterBean
的產生過程有這些特性MetricCollector
隨著特定的 interval 撈出來的 metrics 一樣。ClusterInfo
產生的目前專案內沒有任何手法可以方便我們產生彷彿從
MetricCollector
撈出來的 metrics,想要做到這種效果,要寫很多程式碼。這個 PR 的工具提供一個乾淨且表達性佳的語法來做到這件事情。後面 #1394 會需要透過這個工具來產生和時間有關聯的 metrics。