neetodeploy-autoscale 0.8.0 → 1.0.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: deb2f21200f7b5dabeb6b6b18834172c45b0ea61b6166d29fdde16d48566f93a
4
- data.tar.gz: 4c3b13a11b9f6335e2979f5efcdf71b8b5f911d4a2367a99dee300fcbbae617e
3
+ metadata.gz: cc7cefdb46ea98797e01a08b072dd32cf2a1157833b1d3ee102e6609a3931bc5
4
+ data.tar.gz: a4d797d550f3c28343b119502846fa1e8eabe7401b9c6f342bcf607a51b2f04b
5
5
  SHA512:
6
- metadata.gz: 5122fc863b9758419ad19f4c8d728c1fbdd8ba669e46f487d140bffad9478f107cf0e957879158d5a9c95119b09ccb262108eaca0501aadd3c47f560d9daa1fd
7
- data.tar.gz: ecd6dd377cd1c489b618c7f6b24d3361643f6d27c8640b134530195cbb5fc1a548915ced79ab00371ef1a6d0c7b908453c44474d9683636a0ae7cc3aff29ab0b
6
+ metadata.gz: ceb234f4498a4b0e8b3f508a98476413940d01c530f85e29ff38445acf3c0897738e200b89e0453abc7358c32752dca9b9d4f2a42212d1e9f40357682d4161ed
7
+ data.tar.gz: ca87411a5fae1827f9a6e5168069279bd97d694a9f062dc02f7f554da9826249ab4f96a641f5e5e1090e4e5911bf5b12e99fe5f9d9a7eb0f5e705eef4ee0a10d
@@ -19,8 +19,12 @@ module Neetodeploy
19
19
  post = Net::HTTP::Post.new(url)
20
20
  post["AuthToken"] = "K0An3O3MSyEEMTCnRd1IHgGjdGQkzy"
21
21
 
22
- Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
23
- http.request(post)
22
+ begin
23
+ Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
24
+ http.request(post)
25
+ end
26
+ rescue e
27
+ puts "Exception in sending post request to exporter from Rails process: #{e.message}"
24
28
  end
25
29
 
26
30
  @app.call(env)
@@ -14,15 +14,20 @@ module Neetodeploy
14
14
 
15
15
  queues = queues_by_name.keys
16
16
 
17
- queues.each do |queue_name|
18
- queue = queues_by_name.fetch(queue_name) { |name| ::Sidekiq::Queue.new(name) }
17
+ queues.each do |queue_obj|
18
+ queue = queues_by_name.fetch(queue_obj) { |name| ::Sidekiq::Queue.new(name) }
19
19
 
20
- query_params = URI.encode_www_form(app_name: ENV.to_h["NEETODEPLOY_APP_NAME"], process_type: "worker", queue_name: queue_name, queue_time: queue_time(queue))
20
+ query_params = URI.encode_www_form(app_name: ENV.to_h["NEETODEPLOY_APP_NAME"], process_type: "worker", queue_obj: queue_obj, queue_time: queue_time(queue))
21
21
  url.query = query_params
22
22
  post = Net::HTTP::Post.new(url)
23
23
  post["AuthToken"] = "K0An3O3MSyEEMTCnRd1IHgGjdGQkzy"
24
- Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
25
- http.request(post)
24
+
25
+ begin
26
+ Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
27
+ http.request(post)
28
+ end
29
+ rescue e
30
+ puts "Exception in sending post request to exporter from Sidekiq process: #{e.message}"
26
31
  end
27
32
  end
28
33
 
@@ -35,8 +40,8 @@ module Neetodeploy
35
40
  ::Sidekiq::Queue.all
36
41
  end
37
42
 
38
- def queue_time(queue_name)
39
- queue = ::Sidekiq::Queue.new(queue_name)
43
+ def queue_time(queue_obj)
44
+ queue = ::Sidekiq::Queue.new(queue_obj.name)
40
45
 
41
46
  (queue.latency * 1000).ceil
42
47
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Neetodeploy
4
4
  module Autoscale
5
- VERSION = "0.8.0"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetodeploy-autoscale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sreeram Venkitesh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-19 00:00:00.000000000 Z
11
+ date: 2024-06-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: For automatically scaling your Rails application based on network metrics
14
14
  email: