zuora_connect 1.7.08 → 1.7.09

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5f73ba41b420d1b552236557a910cadb74a0f29
4
- data.tar.gz: a32115c1a42f2774bbb030eeacc5480f0afcc0f4
3
+ metadata.gz: 84f674e406438075bbef02a62232b69cfb9c0105
4
+ data.tar.gz: 9a09ec79a527c28ede8ef3fcd18c6b308bcec58d
5
5
  SHA512:
6
- metadata.gz: e65354cd51cfa0a818a9979a45b217d2535131b1739e15753882db63340f106ec582dc023e865221985746f99b16c725f203b1cdeb08942f6b3ae580d2a5e957
7
- data.tar.gz: d7c556be08e52be64a65f3f9a9ceb9dd95c7a60790076b6de46dfedfe28132efce0d2b45d239c4b4d62da1a9212fd4615b9b095990e966429d37206c00f2a344
6
+ metadata.gz: d39a9ab1e17b478a341caa01c0c9784b61e3600e74e46996ab5161cd4c6c19e21068b06bb990496f140d6a1cf6fcba4772b1fba16e6c3049f87b7ff04d8f8b73
7
+ data.tar.gz: 15aaa257249ceeb2a34b17dd90dd142de8a6eb9bb5ed5891556e8174685c200710d8f37d999893647a316e51cec5e4cb0d6296420a0784327c3a7a96db1239c4
@@ -29,7 +29,7 @@ module ZuoraConnect
29
29
  # To avoid writing metrics from rspec tests
30
30
  if Rails.env.to_sym != :test
31
31
  app_instance = Thread.current[:appinstance].present? ? Thread.current[:appinstance].id : 0
32
- tags = tags.merge({ app_name: app_name, process_type: process_type, app_instance: app_instance, pod_name: pod_name})
32
+ tags = { app_name: app_name, process_type: process_type, app_instance: app_instance, pod_name: pod_name}.merge(tags)
33
33
 
34
34
  if direction == :inbound
35
35
  self.write_udp(series: INBOUND_METRICS_NAME, tags: tags, values: values) if INBOUND_METRICS
@@ -3,7 +3,7 @@ if defined?(Unicorn::WorkerKiller)
3
3
  self.singleton_class.send(:alias_method, :kill_self_old, :kill_self)
4
4
  def self.kill_self(logger, start_time)
5
5
  self.kill_self_old(logger, start_time)
6
- ZuoraConnect::AppInstance.write_to_telegraf(direction: 'Unicorn-Killer', tags: { }, values: {kill: 1})
6
+ ZuoraConnect::AppInstance.write_to_telegraf(direction: 'Unicorn-Killer', tags: {app_instance: 0}, values: {kill: 1})
7
7
  end
8
8
  end
9
9
  end
@@ -47,7 +47,7 @@ module Middleware
47
47
 
48
48
  # If the url contains any CSS or JavaScript files then do not collect metrics for them
49
49
  if ["css", "assets", "jpg", "png", "jpeg", "ico"].any? { |word| env['PATH_INFO'].include?(word) } || /.*\.js$/.match(env['PATH_INFO'])
50
- tags = {status: @status, controller: 'ActionController', action: 'Assets' }
50
+ tags = {status: @status, controller: 'ActionController', action: 'Assets', app_instance: 0}
51
51
  values = {response_time: ((Time.now - start_time)*1000).round(2) }
52
52
  ZuoraConnect::AppInstanceBase.write_to_telegraf(direction: 'request-inbound-assets', tags: tags, values: values)
53
53
  end
@@ -1,6 +1,6 @@
1
1
  module Resque
2
2
  module SilenceDone
3
- def perform_no_finish_log(job)
3
+ def perform_no_log(job)
4
4
  begin
5
5
  if fork_per_job?
6
6
  reconnect
@@ -16,10 +16,55 @@ module Resque
16
16
  end
17
17
  end
18
18
 
19
+ # def work(interval = 5.0, &block)
20
+ # interval = Float(interval)
21
+ # startup
22
+
23
+ # loop do
24
+ # break if shutdown?
25
+
26
+ # unless work_one_job(&block)
27
+ # break if interval.zero?
28
+ # log_with_severity :debug, "Sleeping for #{interval} seconds"
29
+ # procline paused? ? "Paused" : "Waiting for #{queues.join(',')}"
30
+ # sleep interval
31
+ # end
32
+ # end
33
+
34
+ # unregister_worker
35
+ # rescue Exception => exception
36
+ # return if exception.class == SystemExit && !@child && run_at_exit_hooks
37
+ # log_with_severity :error, "Failed to start worker : #{exception.inspect}"
38
+ # unregister_worker(exception)
39
+ # end
40
+
41
+ def work_one_job_no_log(job = nil, &block)
42
+ return false if paused?
43
+ return false unless job ||= reserve
44
+
45
+ working_on job
46
+ procline "Processing #{job.queue} since #{Time.now.to_i} [#{job.payload_class_name}]"
47
+
48
+ #log_with_severity :info, "got: #{job.inspect}"
49
+ job.worker = self
50
+
51
+ if fork_per_job?
52
+ perform_with_fork(job, &block)
53
+ else
54
+ perform(job, &block)
55
+ end
56
+
57
+ done_working
58
+ true
59
+ end
60
+
19
61
  def self.included(receiver)
20
62
  receiver.class_eval do
21
- alias perform_with_finish_log perform
22
- alias perform perform_no_finish_log
63
+ alias work_one_job_with_log work_one_job
64
+ alias work_one_job work_one_job_no_log
65
+
66
+ alias perform_with_log perform
67
+ alias perform perform_no_log
23
68
  end
24
69
  end
25
70
  end
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.7.08"
2
+ VERSION = "1.7.09"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.08
4
+ version: 1.7.09
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-21 00:00:00.000000000 Z
11
+ date: 2018-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment