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

Chore: Round ping value for real-browser monitor type #3930

Closed
wants to merge 1 commit into from

Conversation

chakflying
Copy link
Collaborator

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

The real-browser monitor type should not report sub-milisecond ping value since it's not meaningful.

Type of change

  • User interface (UI)

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas
    (including JSDoc for methods)
  • My changes generate no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

before after
image image

@louislam
Copy link
Owner

Thinking a rare special case, should it be rounded up to 1 if ping > 0 && ping < 1? Because 0ms may be a bit misleading.

Just like file size display on Windows, 0.001KB is always rounded up to 1KB.

@chakflying
Copy link
Collaborator Author

True, but this issue would apply to all monitor types. We can handle this in the front-end display if you want.

@louislam louislam added the question Further information is requested label Nov 24, 2023
@marco-carvalho
Copy link

maybe Math.ceil instead of Math.round?

@louislam
Copy link
Owner

maybe Math.ceil instead of Math.round?

@marco-carvalho I think rounding is better, just handling the ping > 0 && ping < 1 case is ok.

@chakflying Yes, agree. We can do it in the frontned.

@chakflying
Copy link
Collaborator Author

Do you mean handling rounding and <1 in the frontend only, or we should add it while keeping this PR?

@louislam
Copy link
Owner

handling rounding and <1 in the frontend only

I meant this, because it seems like it could cover all monitor types in this way?

@chakflying chakflying closed this Nov 30, 2023
@chakflying chakflying deleted the chore/round-ping branch February 1, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants