g5_prom_rails 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 87dcb8f11ee3931dd32b61ba2388ba60c0a8678e
4
- data.tar.gz: 6b5c35d2de78c04acb370abb11baf1efe314e78d
3
+ metadata.gz: a550648d2600ce6e0646297076ebdf0775481cb1
4
+ data.tar.gz: 0555b5e32a9852ac09b56d4fe71d34dd233146e7
5
5
  SHA512:
6
- metadata.gz: 400c030ba01100d5ee83d4d4944526bcf07e6f885c1c602b01af717499e163b1d96304b39a8b1e393566977a543240a5f0216e15769a8c6781c52423cca05698
7
- data.tar.gz: 2acf2bf0fc20b6cd2c4282c05a943def2f03d3342979d77d6969515b9d7923e52587c5475ccf6f0edeed7a67810e312bc3f74de93bcdf701754ff0aa9e8e2cc9
6
+ metadata.gz: e2f115cedfd41f842f268598ff5106beceb55f9eead7ca007eebe5b63dd11cadbc846ff0c28575912d8ac605f3e8e04d232c238b5187015ebe34113e78c622ce
7
+ data.tar.gz: e3810cbbdeb532a07d5bf7bec765156cfc032a2824b25c46f09752ee019b273811b1ac00df1559e9ba5f902106211cb31b39a53f29379183481449f664193dba
@@ -1,38 +1,44 @@
1
- require 'sidekiq/api'
1
+ begin
2
+ require 'sidekiq/api'
2
3
 
3
- module G5PromRails::SidekiqApplicationMetrics
4
- extend ActiveSupport::Concern
4
+ module G5PromRails::SidekiqApplicationMetrics
5
+ extend ActiveSupport::Concern
5
6
 
6
- def initialize_sidekiq_application
7
- @processed_counter = G5PromRails::SettableCounter.new(
8
- :sidekiq_processed,
9
- "jobs processed"
10
- )
11
- per_application.register(@processed_counter)
12
- @failed_counter = G5PromRails::SettableCounter.new(
13
- :sidekiq_failed,
14
- "jobs failed"
15
- )
16
- per_application.register(@failed_counter)
7
+ def initialize_sidekiq_application
8
+ @processed_counter = G5PromRails::SettableCounter.new(
9
+ :sidekiq_processed,
10
+ "jobs processed"
11
+ )
12
+ per_application.register(@processed_counter)
13
+ @failed_counter = G5PromRails::SettableCounter.new(
14
+ :sidekiq_failed,
15
+ "jobs failed"
16
+ )
17
+ per_application.register(@failed_counter)
17
18
 
18
- @retry_gauge = per_application.gauge(
19
- :sidekiq_retry,
20
- "jobs to be retried"
21
- )
22
- @queues_gauge = per_application.gauge(
23
- :sidekiq_queued,
24
- "job queue lengths"
25
- )
26
- end
19
+ @retry_gauge = per_application.gauge(
20
+ :sidekiq_retry,
21
+ "jobs to be retried"
22
+ )
23
+ @queues_gauge = per_application.gauge(
24
+ :sidekiq_queued,
25
+ "job queue lengths"
26
+ )
27
+ end
27
28
 
28
- def update_sidekiq_statistics
29
- stats = Sidekiq::Stats.new
30
- @processed_counter.set({}, stats.processed)
31
- @failed_counter.set({}, stats.failed)
32
- @retry_gauge.set({}, stats.retry_size)
29
+ def update_sidekiq_statistics
30
+ stats = Sidekiq::Stats.new
31
+ @processed_counter.set({}, stats.processed)
32
+ @failed_counter.set({}, stats.failed)
33
+ @retry_gauge.set({}, stats.retry_size)
33
34
 
34
- Sidekiq::Stats::Queues.new.lengths.each do |queue, length|
35
- @queues_gauge.set({ queue: queue }, length)
35
+ Sidekiq::Stats::Queues.new.lengths.each do |queue, length|
36
+ @queues_gauge.set({ queue: queue }, length)
37
+ end
36
38
  end
37
39
  end
40
+ rescue LoadError
41
+ if defined?(Sidekiq)
42
+ puts "problem loading sidekiq/api in g5_prom_rails, but you have sidekiq"
43
+ end
38
44
  end
@@ -1,3 +1,3 @@
1
1
  module G5PromRails
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_prom_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails