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

Feat: Use UptimeCalculator for PingChart #4264

Merged
merged 26 commits into from
May 19, 2024

Conversation

chakflying
Copy link
Collaborator

@chakflying chakflying commented Dec 20, 2023

⚠️⚠️⚠️ 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

Depends on #4267
Depends on #4406
Resolves #2251 as the jitter is now "printed"

Update PingChart to use data from the new UptimeCalculator.

  • Use 3 line charts to show the min, max and avg ping together for better visualization
  • Avoid modifying heartbeatList, and instead store the received data in a separate data structure.
  • With this method, there seems to be no easy way to show the maintenance period. How should we handle this? Adding another column in the stat_minutely tables seems wasteful.

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to not work as expected)

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 generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

image

image

@chakflying chakflying added this to the 2.0.0 milestone Dec 20, 2023
@chakflying chakflying added the area:metrics related to monitoring metrics label Dec 20, 2023
@louislam louislam mentioned this pull request Dec 21, 2023
17 tasks
@chakflying
Copy link
Collaborator Author

Realized the stat_daily data is not really useful for the chart. There would only be 7 data points for the 1 week chart, and there would be no meaningful information about when up/down events occurred.

Ideally we'd have a stat_hourly covering a couple of weeks. Currently going from minute to day is a 2 orders of magnitude increase, and one might say it's too big anyway. But doing this would also increase a bit of complexity, and I don't know if the data would be useful elsewhere.

@chakflying
Copy link
Collaborator Author

chakflying commented Jan 5, 2024

Rebased on master, did a quick test and seems to work okay. Still have a couple of issues:

  • Will return value 0 even for monitors without ping value. Might need special handling for this
  • No handling for maintenance periods

@louislam
Copy link
Owner

louislam commented Jan 5, 2024

Depends on #4267

#4267 had been merged, for your info.

@chakflying
Copy link
Collaborator Author

chakflying commented Jan 18, 2024

@louislam have you thought about how to store past maintenance information? I'm leaning towards adding a new column in the stats tables, so that it's indexable. However, if we think about having many other values to keep track of in the future, it may be better to have an "extras" column, then json encode the values. {"maintenance": 10, "slow_response": 2}

@louislam
Copy link
Owner

Yes, I think it is a good idea to have a column for extra stats.

@chakflying
Copy link
Collaborator Author

Maintenance should now also be shown.

image

Branch will be rebased again once #4406 is merged.

@chakflying
Copy link
Collaborator Author

Also fixed a long standing issue where the ping line would get weirdly connected if the server was turned off for a while.

Screenshot 2024-01-27 012838

@chakflying chakflying marked this pull request as ready for review April 6, 2024 16:37
CommanderStorm

This comment was marked as resolved.

chakflying and others added 6 commits April 9, 2024 13:41
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

From my point of view, this is mergable. (tested and this works as intended)
@louislam would you like to review this too?

@CommanderStorm CommanderStorm added area:dashboard The main dashboard page where monitors' status are shown and removed area:metrics related to monitoring metrics labels Apr 15, 2024
@CommanderStorm
Copy link
Collaborator

From my point of view, this is mergable. (tested and this works as intended)
@louislam would you like to review this too?

I guess that is a no on an additional review.
=> merging with junior maintainer approval
(if you still have something, I will obv. provide a PR as previously done ^^)

@CommanderStorm CommanderStorm merged commit a581a85 into louislam:master May 19, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dashboard The main dashboard page where monitors' status are shown
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[http] display jitter (max - min latency)
4 participants