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

Dashboard Chart with auto update #197

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MacLove13
Copy link

@MacLove13 MacLove13 commented Nov 7, 2024

I made some changes to be able to search the database, due to the control of created_at and finished_at.

The Navigation Menu will now update automatically every 5 seconds.

The Dashboard chat will update according to the time chosen in the uptime dropdown menu. By default, it is also 5 seconds.

The graph will also show the last 20 records according to the dropdown, for example, last 20 seconds.

When you enter the screen, the graph will be empty and will be filled as you watch it.

Features:

  • Add ChartJS
  • Dashboard page
  • Chart with auto update showing Pending, Success and Error ActiveJobs (Auto update time adjustable)
  • Dashboard Header Boxes with Jobs count (Auto update with chart uptime)
  • Auto update Navigation (Auto update fixed in 5 seconds)

Preview:
image


Gravacao.de.Tela.2024-11-10.as.18.26.05.mov

@MacLove13 MacLove13 changed the title Dashboard Chart with auto update [WIP] Dashboard Chart with auto update Nov 7, 2024
@MacLove13 MacLove13 force-pushed the feat/DashboardChart branch 5 times, most recently from 839c0a4 to f02f978 Compare November 10, 2024 23:00
@MacLove13 MacLove13 changed the title [WIP] Dashboard Chart with auto update Dashboard Chart with auto update Nov 10, 2024
@MacLove13 MacLove13 force-pushed the feat/DashboardChart branch 2 times, most recently from 2541d68 to 65798c2 Compare November 10, 2024 23:20
@MacLove13
Copy link
Author

The navigation bar ended up scrolling in some resolutions and depending on the number of records in the queues (which are displayed in the navbar)

I intend to make more visual changes that will probably improve this.

@MacLove13
Copy link
Author

MacLove13 commented Nov 10, 2024

I'm trying to see a way to make it work with resque... I've never worked with resque, I'm not sure how I'm going to do it.

For now I will leave it exclusive to solid_queue

@MacLove13
Copy link
Author

@rosa I removed the WIP, I'm open to suggestions on the code.
From the tests I've done, everything seems to be working fine with solid_queue.

@rosa
Copy link
Member

rosa commented Nov 11, 2024

Hey @MacLove13, thanks for this! I like the idea but not that it's completely tied to Solid Queue, unlike the other pages in Mission Control. Abstractions like ActiveJob::Queue, ActiveJob::JobsRelation, etc. were created precisely for this, so that they could be used from controllers without having to reach for adapters' internals, and, could work easily with Resque, Solid Queue or other adapters. This introduces functionality that only works with Solid Queue and bypasses all of those abstractions, which right now is a no-go, I'm afraid.

@MacLove13
Copy link
Author

MacLove13 commented Nov 12, 2024

Hey @MacLove13, thanks for this! I like the idea but not that it's completely tied to Solid Queue, unlike the other pages in Mission Control. Abstractions like ActiveJob::Queue, ActiveJob::JobsRelation, etc. were created precisely for this, so that they could be used from controllers without having to reach for adapters' internals, and, could work easily with Resque, Solid Queue or other adapters. This introduces functionality that only works with Solid Queue and bypasses all of those abstractions, which right now is a no-go, I'm afraid.

I tried to do it using abstractions, but I couldn't do a where by dates/time in a way that doesn't impact performance. I'll try a few more things in the next few days to remove the direct use of the database and use abstractions.

Memory usage for filtering jobs becomes a major bottleneck for fast auto update

@MacLove13 MacLove13 mentioned this pull request Nov 20, 2024
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