-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Dashboard] Enable customizable refresh frequency for the Metrics page #44037
[Dashboard] Enable customizable refresh frequency for the Metrics page #44037
Conversation
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Signed-off-by: Xiaoshuang Liu <liuxiaoshuang4@huawei.com>
e050fcd
to
71b4656
Compare
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.
Nice, thanks for adding this.
Can you also add this to the metrics section of the service page and the serve deployment page?
@@ -377,6 +421,8 @@ export const Metrics = () => { | |||
const toParam = to !== null ? `&to=${to}` : ""; | |||
const timeRangeParams = `${fromParam}${toParam}`; | |||
|
|||
const refreshParams = refresh !== "" ? `&refresh=${refresh}` : ""; |
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.
const refreshParams = refresh !== "" ? `&refresh=${refresh}` : ""; | |
const refreshParams = refresh ? `&refresh=${refresh}` : ""; |
Since refresh can also be null
?
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.
That's right, modified.
@@ -358,13 +390,25 @@ export const Metrics = () => { | |||
|
|||
const grafanaDefaultDatasource = dashboardDatasource ?? "Prometheus"; | |||
|
|||
const [refreshOption, setRefreshOption] = useState<RefreshOptions>( | |||
RefreshOptions.ONE_SECOND, |
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.
Can we make the default five seconds? one second seems too frequent.
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.
Sure! Five seconds is also the frequency we prefer. I was worried that changing from continuous updates to five seconds would change the habits of historical users. Seems like an unnecessary worry.
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Sure! Has also been added to the service and serve deployment page. |
@liuxsh9 can you add a short recording of how it looks like? (sorry, I'm not fluent at building the frontend and checking it out by myself. It will be easier for me to take a look at the recording) |
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
…text appears Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Great suggestion! How about this? @alanwguo @scottsun94 |
LGTM. Thanks! |
Co-authored-by: Huaiwei Sun <scottsun94@gmail.com> Signed-off-by: Xiaoshuang Liu <liuxiaoshuang4@huawei.com>
Signed-off-by: liuxsh9 <liuxiaoshuang4@huawei.com>
Based on testing, the lowest available refresh rate was found to be 5 seconds, so the 1 second option was removed. |
@alanwguo Hi alan, do you think this PR is ready to be merged? |
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, thanks!
I'll have someone merge after tests pass
Why are these changes needed?
Currently, each chart on the Metrics page is continuously refreshing, which can put strain on the network and frontend. In our application with @nemo9cby @Bye-legumes, we have noticed that during periods of unstable cluster networks, there can be instances of response timeouts or loss.
Therefore, having the ability to customize the refresh frequency would be helpful.
In the proposed modification, we have set the default refresh frequency to 1 second and provided various frequency configurations, following the example of Grafana. This way, users can choose the refresh interval that best suits their needs.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.