hirefireapp 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/hirefireapp.gemspec +1 -1
- data/lib/hirefireapp/middleware.rb +14 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09ece4ab764a8b91c0f9c27c7e4a204a47dd86de
|
4
|
+
data.tar.gz: 99e0c0b349e1569248c39ec944f3ef0a3373b923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bf29825cbd84054ab4a4b25fb26bc27b9eb3576de0a9af60b03ada2ec847d60a6b36a11dca4a51cb27b96dd326edddcb9199e28d91bc9c688c9b41e2d524e49
|
7
|
+
data.tar.gz: 49c80645f395a935b8fcedae2c90d17bdb0232fc0bce725e2cf487c4d438821bc9f18a7b2fb432266f4f8f0df4e31d964f6c970aaeed64f6196ccd07dc6b189c
|
data/hirefireapp.gemspec
CHANGED
@@ -9,7 +9,7 @@ module HireFireApp
|
|
9
9
|
#
|
10
10
|
def initialize(app)
|
11
11
|
@app = app
|
12
|
-
@token = ENV['HIREFIREAPP_TOKEN']
|
12
|
+
@token = ENV['HIREFIREAPP_TOKEN'] || "development"
|
13
13
|
end
|
14
14
|
|
15
15
|
##
|
@@ -129,8 +129,19 @@ module HireFireApp
|
|
129
129
|
# the number of jobs pending + the amount of workers currently working
|
130
130
|
#
|
131
131
|
def count_resque
|
132
|
-
|
133
|
-
|
132
|
+
queues = ::Resque.queues
|
133
|
+
|
134
|
+
in_queues = queues.inject(0) do |memo, queue|
|
135
|
+
memo += ::Resque.size(queue)
|
136
|
+
memo
|
137
|
+
end
|
138
|
+
|
139
|
+
in_progress = ::Resque::Worker.all.inject(0) do |memo, worker|
|
140
|
+
memo += 1 if queues.include?(worker.job["queue"])
|
141
|
+
memo
|
142
|
+
end
|
143
|
+
|
144
|
+
in_queues + in_progress
|
134
145
|
end
|
135
146
|
|
136
147
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirefireapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: HireFire.io - The Heroku Dyno Manager - Autoscaling your web and worker
|
14
14
|
dynos saving you time and money!
|