rails-autoscale-solid_queue 1.6.0 → 1.7.1

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: 810865e372910f93b1928a0d7a38cc54903b42bd0137242d1c2db4a267d1b48b
4
- data.tar.gz: 31dd78538f4e3d5c73f1764c4574f32d5893d28dbdc33ea873077f799b650095
3
+ metadata.gz: a9ac87bdf87c775f730c15fd862fa6389bd6ef5a4d1a5b20bb729c2bb3e1f983
4
+ data.tar.gz: 7230371458edd999fa8293cceee84a86703692507be2203d22cc566061b94a9b
5
5
  SHA512:
6
- metadata.gz: af8d5ee5e5072c33330f69d19cea3c4bb7deb217f4e250972b8a26e2bdd7b48b68ec024f42d6853d37fd22e3b75bc58e493fa6dfe540f08c2fec19966fdb1d2c
7
- data.tar.gz: cbdd94a183b975f94bfa639efc3252511d81d1aa8b343a8779faf0e385c28a0140f9d5e5d39006c69d270c5ccca84b741b2f876732ca3b15e85693ff9fb3cc1f
6
+ metadata.gz: a095b44bfa3050e8abb36e2ef9455ff517f84f6bd695c0e0f4c1069485970f3672a8e353f70c11c05573c3a30c697ce7f22dcac40813494b54d83862f818ef03
7
+ data.tar.gz: df95c2e57e7ac16e0aaa1655c30a7071798a427aacb8bf82e3515960f66856cac68db60eb638335d4f1421cd646a79df775eb5c3c02b7b4c33faaa4174d02fb8
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "judoscale/solid_queue"
3
+ require "judoscale-solid_queue"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-autoscale-solid_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.1
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-04-26 00:00:00.000000000 Z
13
+ date: 2024-07-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rails-autoscale-core
16
+ name: judoscale-solid_queue
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.6.0
21
+ version: 1.7.1
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.6.0
29
- - !ruby/object:Gem::Dependency
30
- name: solid_queue
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: '0.3'
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: '0.3'
28
+ version: 1.7.1
43
29
  description:
44
30
  email:
45
31
  - hello@judoscale.com
@@ -47,15 +33,7 @@ executables: []
47
33
  extensions: []
48
34
  extra_rdoc_files: []
49
35
  files:
50
- - Gemfile
51
- - Rakefile
52
- - judoscale-solid_queue.gemspec
53
- - lib/judoscale-solid_queue.rb
54
- - lib/judoscale/solid_queue.rb
55
- - lib/judoscale/solid_queue/metrics_collector.rb
56
- - lib/judoscale/solid_queue/version.rb
57
36
  - lib/rails-autoscale-solid_queue.rb
58
- - rails-autoscale-solid_queue.gemspec
59
37
  homepage: https://judoscale.com
60
38
  licenses:
61
39
  - MIT
@@ -73,16 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
51
  requirements:
74
52
  - - ">="
75
53
  - !ruby/object:Gem::Version
76
- version: 2.7.0
54
+ version: '0'
77
55
  required_rubygems_version: !ruby/object:Gem::Requirement
78
56
  requirements:
79
57
  - - ">="
80
58
  - !ruby/object:Gem::Version
81
59
  version: '0'
82
60
  requirements: []
83
- rubygems_version: 3.4.10
61
+ rubygems_version: 3.5.11
84
62
  signing_key:
85
63
  specification_version: 4
86
- summary: This gem provides SolidQueue integration with the Judoscale autoscaling add-on
87
- for Heroku.
64
+ summary: Autoscaling for Solid Queue workers.
88
65
  test_files: []
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec name: "judoscale-solid_queue"
4
-
5
- gem "judoscale-ruby", path: "../judoscale-ruby"
6
- gem "activerecord"
7
- gem "pg"
8
- gem "minitest"
9
- gem "rake"
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/solid_queue/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "judoscale-solid_queue"
7
- spec.version = Judoscale::SolidQueue::VERSION
8
- spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "This gem provides SolidQueue integration with the Judoscale autoscaling add-on for Heroku."
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.7.0"
27
-
28
- spec.add_dependency "judoscale-ruby", Judoscale::SolidQueue::VERSION
29
- spec.add_dependency "solid_queue", ">= 0.3"
30
- end
@@ -1,63 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/job_metrics_collector"
4
- require "judoscale/job_metrics_collector/active_record_helper"
5
- require "judoscale/metric"
6
-
7
- module Judoscale
8
- module SolidQueue
9
- class MetricsCollector < Judoscale::JobMetricsCollector
10
- include ActiveRecordHelper
11
-
12
- def self.adapter_config
13
- Judoscale::Config.instance.solid_queue
14
- end
15
-
16
- def self.collect?(config)
17
- super && ActiveRecordHelper.table_exists_for_model?(::SolidQueue::Job)
18
- end
19
-
20
- def initialize
21
- super
22
-
23
- queue_names = run_silently do
24
- ::SolidQueue::Job.distinct.pluck(:queue_name)
25
- end
26
- self.queues |= queue_names
27
- end
28
-
29
- def collect
30
- metrics = []
31
- time = Time.now.utc
32
-
33
- oldest_execution_time_by_queue = run_silently do
34
- ::SolidQueue::ReadyExecution.group(:queue_name).minimum(:created_at)
35
- end
36
- self.queues |= oldest_execution_time_by_queue.keys
37
-
38
- if track_busy_jobs?
39
- busy_count_by_queue = run_silently do
40
- ::SolidQueue::Job.joins(:claimed_execution).group(:queue_name).count
41
- end
42
- self.queues |= busy_count_by_queue.keys
43
- end
44
-
45
- queues.each do |queue|
46
- run_at = oldest_execution_time_by_queue[queue]
47
- latency_ms = run_at ? ((time - run_at) * 1000).ceil : 0
48
- latency_ms = 0 if latency_ms < 0
49
-
50
- metrics.push Metric.new(:qt, latency_ms, time, queue)
51
-
52
- if track_busy_jobs?
53
- busy_count = busy_count_by_queue[queue] || 0
54
- metrics.push Metric.new(:busy, busy_count, Time.now, queue)
55
- end
56
- end
57
-
58
- log_collection(metrics)
59
- metrics
60
- end
61
- end
62
- end
63
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Judoscale
4
- module SolidQueue
5
- VERSION = "1.6.0"
6
- end
7
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "solid_queue"
4
- require "judoscale-ruby"
5
- require "judoscale/config"
6
- require "judoscale/solid_queue/version"
7
- require "judoscale/solid_queue/metrics_collector"
8
-
9
- Judoscale.add_adapter :"judoscale-solid_queue",
10
- {
11
- adapter_version: Judoscale::SolidQueue::VERSION,
12
- framework_version: ::SolidQueue::VERSION
13
- },
14
- metrics_collector: Judoscale::SolidQueue::MetricsCollector,
15
- expose_config: Judoscale::Config::JobAdapterConfig.new(:solid_queue)
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "judoscale/solid_queue"
@@ -1,30 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "judoscale/solid_queue/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "rails-autoscale-solid_queue"
7
- spec.version = Judoscale::SolidQueue::VERSION
8
- spec.authors = ["Adam McCrea", "Carlos Antonio da Silva", "Jon Sullivan"]
9
- spec.email = ["hello@judoscale.com"]
10
-
11
- spec.summary = "This gem provides SolidQueue integration with the Judoscale autoscaling add-on for Heroku."
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.7.0"
27
-
28
- spec.add_dependency "rails-autoscale-core", Judoscale::SolidQueue::VERSION
29
- spec.add_dependency "solid_queue", ">= 0.3"
30
- end