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

[COMMON] Implementation of MetricSeriesBuilder #1412

Merged
merged 7 commits into from
Jan 16, 2023

Conversation

garyparrot
Copy link
Collaborator

這個 PR 提出一個簡易的手法來對產生某個 ClusterInfo 的假 ClusterBean,且這個假的 ClusterBean 的產生過程有這些特性

  1. ClusterBean 裡面的 metrics 是隨著時間軸連續產生的,彷彿他是從 MetricCollector 隨著特定的 interval 撈出來的 metrics 一樣。
  2. ClusterBean 裡面的 metrics 是針對給定的 ClusterInfo 產生的
  3. 這個 ClusterBean 可以包含多種不同類型的 metrics。

目前專案內沒有任何手法可以方便我們產生彷彿從 MetricCollector 撈出來的 metrics,想要做到這種效果,要寫很多程式碼。這個 PR 的工具提供一個乾淨且表達性佳的語法來做到這件事情。

後面 #1394 會需要透過這個工具來產生和時間有關聯的 metrics。

@garyparrot
Copy link
Collaborator Author

@chia7712 能夠幫我看一下概念嗎,如果沒問題我再推具體實作和測試

@chia7712
Copy link
Contributor

產生某個 ClusterInfo 的假 ClusterBean

這個概念是不錯,不過在實作上比較難想像,畢竟我們預期 metrics 有非常多種和組合,甚至有一些是 cost 內部自己的統計結果。另外請問預期是哪一個元件要負責去“產生這個模擬的 ClusterBean"? 如果不是 cost 自己去產生的話,那外部物件可能也無法理解 cost 自行組合的 metrics

@garyparrot
Copy link
Collaborator Author

garyparrot commented Jan 11, 2023

另外請問預期是哪一個元件要負責去“產生這個模擬的 ClusterBean"? 如果不是 cost 自己去產生的話,那外部物件可能也無法理解 cost 自行組合的 metrics

這個東西不會直接被 Astraea 的 End User 使用,他不會屬於任何對外的元件, MetricSeriesBuilder 的用途比較像是在讓寫 Cost 的人能在測試裡面利用他產生測試用的 ClusterBean,還有讓寫 Cost 的人私下實驗負載優化效果用(比如#1108)

@chia7712
Copy link
Contributor

MetricSeriesBuilder 的用途比較像是在讓寫 Cost 的人能在測試裡面利用他產生測試用的 ClusterBean,還有讓寫 Cost 的人私下實驗負載優化效果用(比如#1108)

所以主要是測試用途嗎?如果是的話,有一個方便建構ClusterBean的工具就很不錯 +1

@garyparrot
Copy link
Collaborator Author

所以主要是測試用途嗎?如果是的話,有一個方便建構ClusterBean的工具就很不錯 +1

是的,主要是測試用,我後面會補上具體實作,感謝

@garyparrot garyparrot marked this pull request as ready for review January 11, 2023 16:52
@garyparrot garyparrot changed the title Implementation of MetricSeriesBuilder [COMMON] Implementation of MetricSeriesBuilder Jan 15, 2023
@garyparrot garyparrot self-assigned this Jan 15, 2023
Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,接下來就看各個 cost 用起來如何

@garyparrot garyparrot merged commit 4458af5 into opensource4you:main Jan 16, 2023
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

Successfully merging this pull request may close these issues.

2 participants