DEV Community

ShinaBR2
ShinaBR2

Posted on

Shitty but works extension

Well, I don't have too much time but I need to monitor my production Sidekiq. The problem is, that I want to monitor how often jobs in one specific queue are executed after enqueued.
Please google/AI_ing first if you don't know what Sidekiq is.
A popup question? Why not ask AI to create a new extension for that. Yes, why not? Just do it.


Let's start.

Here is what I ask AI

Can you write a chrome extension for Sidekiq, what I want to achieve:
* In the "busy" Sidekiq tab, figure out what queues we have
* I want a simple select to filter the queue. Let's say I open the extension and filter by default queue, now the "busy" page only shows jobs in the default queue
Enter fullscreen mode Exit fullscreen mode

Bump! It generates for me the needed files and it works, of course but not 100% cases. It does not handle really well the auto polling because I'm too lazy to hit the refresh button.

The problem comes because Sidekiq will auto-reload the HTML content when I use auto-polling.

Then I continued asking it and finally, I found the simplest way is just using setInterval to apply the filter in each second.

Jobs are done in just around 15 or 20 minutes. And I push the code here: https://github.com/shinaBR2/shitty-but-works-sidekiq-queue-filter

Like it's name, shitty but it works.


In AI era, we can:

  • Quickly propose solution in few minutes
  • Make code easier than ever

And I tell you the last but top secret. Startup will wrap this thing into a beautiful dialog using the most UI framework and introduce it as SaaS and you need to pay money for each month.

Happy coding!

Top comments (0)