1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Remove href locator and switch to report just sizes

This commit is contained in:
Moser, Kevin 2014-12-24 11:29:51 -08:00
parent cff1516bdd
commit 3689c11753
2 changed files with 8 additions and 25 deletions

View file

@ -238,27 +238,16 @@ module Sidekiq
scheduled: sidekiq_stats.scheduled_size,
retries: sidekiq_stats.retry_size,
dead: sidekiq_stats.dead_size,
queues: {
count: queues.size,
href: "#{uri}/queues"
}
queues: queues.size
)
end
get '/stats/queues' do
queues = Sidekiq::Queue.all
queue_sizes = queues.reduce({}) do |ret, queue|
ret[queue.name] = {
depth: queue.size,
href: "#{uri}/#{queue.name}"
}
ret
end
stats = Sidekiq::Stats.new
content_type :json
Sidekiq.dump_json(
queue_sizes
stats.queues
)
end
@ -267,9 +256,7 @@ module Sidekiq
content_type :json
Sidekiq.dump_json(
name: queue.name,
depth: queue.size,
href: uri
size: queue.size
)
end

View file

@ -390,7 +390,7 @@ class TestWeb < Sidekiq::Test
end
it 'reports queue count' do
assert_equal 1, @response["queues"]["count"]
assert_equal 1, @response["queues"]
end
describe 'queues' do
@ -400,7 +400,7 @@ class TestWeb < Sidekiq::Test
end
it 'reports the queue depth' do
assert_equal 0, @response["default"]["depth"]
assert_equal 0, @response["default"]
end
end
@ -410,12 +410,8 @@ class TestWeb < Sidekiq::Test
@response = Sidekiq.load_json(last_response.body)
end
it 'reports the queue depth' do
assert_equal 0, @response["depth"]
end
it 'reports the queue name' do
assert_equal 'default', @response["name"]
it 'reports the queue size' do
assert_equal 0, @response["size"]
end
end
end