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

Counting jobs for queue X that have to run at Time.now? #193

Open
mrrooijen opened this issue Nov 15, 2012 · 2 comments
Open

Counting jobs for queue X that have to run at Time.now? #193

mrrooijen opened this issue Nov 15, 2012 · 2 comments
Assignees
Labels

Comments

@mrrooijen
Copy link

Hi,

How would one go about counting specific and all queues sizes that are set to run right Time.now? I have had some requests to support Resque scheduler for a service and require these metrics in order to do so.

I need to be able to do something along lines of:

returns an Integer representing all jobs that must run "now" for all queues

ResqueScheduler.queue # => 23

returns an Integer representing all jobs that must run "now" for the :urgent queue

ResqueScheduler.queue(:urgent) # => 5

Is there a way to do this? If so, what logic would go here to accomplish this?

class ResqueScheduler
  def self.queue(queue = nil)
    # ...
  end
end

Any help much appreciated! Thanks!

@ksinkar ksinkar self-assigned this Feb 14, 2014
@ksinkar ksinkar added this to the Release v2.5.3 milestone Feb 14, 2014
@ksinkar ksinkar modified the milestones: Release v2.5.7, Release v2.5.3 Feb 14, 2014
@ksinkar
Copy link
Contributor

ksinkar commented Feb 14, 2014

@meskyanichi This does not seem to be a bug. It is more of a feature request. Can you make a case, that your particular idea may have more value for average users of resque-scheduler? We could add those statistics in the UI itself. If you have already solved this problem, let us know how you did it.

If @meatballhat @bugant, do you think this could be a feature for resque-scheduler?

@meatballhat
Copy link
Member

@ksinkar I think @meskyanichi definitely meant it as a feature request 😃 Considering how long it's been since this issue was created, I would ask if it's even wanted anymore. If so, it seems reasonable to me to take a crack at implementing something that would go out with v3.x.x.

@meatballhat meatballhat removed this from the Release v3.0.0 milestone May 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants