rails-autoscale-resque 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 555ec6eb324ac84384adaf31512d575d330f0dcad06b54ab94106b0d10a81dfb
4
- data.tar.gz: 2e26db5c489a7e6c98d6e461f7434878031d46559e2ea99b7837cd15d559bf8b
3
+ metadata.gz: 87d3d1572a095dab053e9529b443c8fd7a4022100032187915520cf760ed6b0a
4
+ data.tar.gz: a5b39392f9741522b7a0958a0275325795a0fd7b19c0f5b402d4189ec60c51d0
5
5
  SHA512:
6
- metadata.gz: 8a1bc82ce370e7367df0d6dcf95e315453c344336d63fd061e03e0cd00904519c2bc06f761392449cdc7e5b3a1641260ff673d6abb3b8e403a6ac30e6a2d4fba
7
- data.tar.gz: 170309f4e2caa1dc9909544c671ab54904966f92c0bf05100aa5aa42219e94df312b1654a20d542afe90c3d27b8a361feb3b10cc7ce13fac0e9418820f57d0cf
6
+ metadata.gz: 8ad265c26cfe2e0f3436cb762ae51876493585105546a4c902ab9dd9690a2c1b029777b6c2eac90186bbf6f1f5bbe460bce2f50586367417f840364a6529b5ab
7
+ data.tar.gz: 29618f9e8a726e8744fd922e2b416a816aa543834e73a92a5257a836cd42aba9b33f14029712e476aa375bd26ad38d915fac39ac21fef52124d242e06dc0a75c
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "judoscale/resque"
3
+ require "judoscale-resque"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-autoscale-resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea
@@ -10,36 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-03 00:00:00.000000000 Z
13
+ date: 2024-07-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rails-autoscale-core
16
+ name: judoscale-resque
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.7.0
21
+ version: 1.8.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.7.0
29
- - !ruby/object:Gem::Dependency
30
- name: resque
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '2.0'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '2.0'
28
+ version: 1.8.0
43
29
  description:
44
30
  email:
45
31
  - hello@judoscale.com
@@ -47,16 +33,7 @@ executables: []
47
33
  extensions: []
48
34
  extra_rdoc_files: []
49
35
  files:
50
- - Gemfile
51
- - Rakefile
52
- - judoscale-resque.gemspec
53
- - lib/judoscale-resque.rb
54
- - lib/judoscale/resque.rb
55
- - lib/judoscale/resque/latency_extension.rb
56
- - lib/judoscale/resque/metrics_collector.rb
57
- - lib/judoscale/resque/version.rb
58
36
  - lib/rails-autoscale-resque.rb
59
- - rails-autoscale-resque.gemspec
60
37
  homepage: https://judoscale.com
61
38
  licenses:
62
39
  - MIT
@@ -74,14 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
51
  requirements:
75
52
  - - ">="
76
53
  - !ruby/object:Gem::Version
77
- version: 2.6.0
54
+ version: '0'
78
55
  required_rubygems_version: !ruby/object:Gem::Requirement
79
56
  requirements:
80
57
  - - ">="
81
58
  - !ruby/object:Gem::Version
82
59
  version: '0'
83
60
  requirements: []
84
- rubygems_version: 3.4.10
61
+ rubygems_version: 3.5.11
85
62
  signing_key:
86
63
  specification_version: 4
87
64
  summary: Autoscaling for Resque workers.
data/Gemfile DELETED
@@ -1,14 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec name: "judoscale-resque"
4
-
5
- gem "judoscale-ruby", path: "../judoscale-ruby"
6
- gem "minitest"
7
- gem "rake"
8
- gem "debug"
9
-
10
- # Lock to known working versions to keep tests passing.
11
- # Without this, `bundle install` will update `Gemfile.lock` due to
12
- # https://github.com/rubygems/bundler/issues/6069
13
- gem "resque", "~> 2.2.0"
14
- gem "redis", "~> 4.0"
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rake/testtask"
4
-
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs << "lib"
7
- t.libs << "test"
8
- t.test_files = FileList["test/**/*_test.rb"]
9
- end
10
-
11
- task default: :test
@@ -1,30 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "judoscale/resque/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "judoscale-resque"
7
- spec.version = Judoscale::Resque::VERSION
8
- spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "Autoscaling for Resque workers."
12
- spec.homepage = "https://judoscale.com"
13
- spec.license = "MIT"
14
-
15
- spec.metadata = {
16
- "homepage_uri" => "https://judoscale.com",
17
- "bug_tracker_uri" => "https://github.com/judoscale/judoscale-ruby/issues",
18
- "documentation_uri" => "https://judoscale.com/docs",
19
- "changelog_uri" => "https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md",
20
- "source_code_uri" => "https://github.com/judoscale/judoscale-ruby"
21
- }
22
-
23
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
- spec.require_paths = ["lib"]
25
-
26
- spec.required_ruby_version = ">= 2.6.0"
27
-
28
- spec.add_dependency "judoscale-ruby", Judoscale::Resque::VERSION
29
- spec.add_dependency "resque", ">= 2.0"
30
- end
@@ -1,23 +0,0 @@
1
- module Judoscale
2
- module Resque
3
- module LatencyExtension
4
- # Store the time when jobs are pushed to the queue in order to calculate latency.
5
- def push(queue, item)
6
- item["timestamp"] = Time.now.utc.to_f
7
- super
8
- end
9
-
10
- # Calculate latency for the given queue using the stored timestamp of the oldest item in the queue.
11
- def latency(queue)
12
- if (item = peek(queue))
13
- timestamp = item["timestamp"]
14
- timestamp ? Time.now.utc.to_f - timestamp.to_f : 0.0
15
- else
16
- 0.0
17
- end
18
- end
19
- end
20
- end
21
- end
22
-
23
- ::Resque.extend(Judoscale::Resque::LatencyExtension)
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/job_metrics_collector"
4
- require "judoscale/metric"
5
-
6
- module Judoscale
7
- module Resque
8
- class MetricsCollector < Judoscale::JobMetricsCollector
9
- def self.adapter_config
10
- Judoscale::Config.instance.resque
11
- end
12
-
13
- def collect
14
- metrics = []
15
- current_queues = ::Resque.queues
16
-
17
- if track_busy_jobs?
18
- busy_counts = Hash.new { |h, k| h[k] = 0 }
19
-
20
- ::Resque.working.each do |worker|
21
- if !worker.idle? && (job = worker.job)
22
- busy_counts[job["queue"]] += 1
23
- end
24
- end
25
- end
26
-
27
- self.queues |= current_queues
28
-
29
- queues.each do |queue|
30
- next if queue.nil? || queue.empty?
31
- depth = ::Resque.size(queue)
32
- latency = (::Resque.latency(queue) * 1000).ceil
33
-
34
- metrics.push Metric.new(:qd, depth, Time.now, queue)
35
- metrics.push Metric.new(:qt, latency, Time.now, queue)
36
-
37
- if track_busy_jobs?
38
- busy_count = busy_counts[queue]
39
- metrics.push Metric.new(:busy, busy_count, Time.now, queue)
40
- end
41
- end
42
-
43
- log_collection(metrics)
44
- metrics
45
- end
46
- end
47
- end
48
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Judoscale
4
- module Resque
5
- VERSION = "1.7.0"
6
- end
7
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale-ruby"
4
- require "judoscale/config"
5
- require "judoscale/resque/version"
6
- require "judoscale/resque/metrics_collector"
7
- require "resque"
8
- require "judoscale/resque/latency_extension"
9
-
10
- Judoscale.add_adapter :"judoscale-resque",
11
- {
12
- adapter_version: Judoscale::Resque::VERSION,
13
- framework_version: ::Resque::VERSION
14
- },
15
- metrics_collector: Judoscale::Resque::MetricsCollector,
16
- expose_config: Judoscale::Config::JobAdapterConfig.new(:resque)
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/resque"
@@ -1,30 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "judoscale/resque/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "rails-autoscale-resque"
7
- spec.version = Judoscale::Resque::VERSION
8
- spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "Autoscaling for Resque workers."
12
- spec.homepage = "https://judoscale.com"
13
- spec.license = "MIT"
14
-
15
- spec.metadata = {
16
- "homepage_uri" => "https://judoscale.com",
17
- "bug_tracker_uri" => "https://github.com/judoscale/judoscale-ruby/issues",
18
- "documentation_uri" => "https://judoscale.com/docs",
19
- "changelog_uri" => "https://github.com/judoscale/judoscale-ruby/blob/main/CHANGELOG.md",
20
- "source_code_uri" => "https://github.com/judoscale/judoscale-ruby"
21
- }
22
-
23
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
- spec.require_paths = ["lib"]
25
-
26
- spec.required_ruby_version = ">= 2.6.0"
27
-
28
- spec.add_dependency "rails-autoscale-core", Judoscale::Resque::VERSION
29
- spec.add_dependency "resque", ">= 2.0"
30
- end