newrelic-rmq-plugin 0.1.2 → 0.1.3

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: b5f2cb45aecb7f8f8979269863d67b8141d04ffd
4
- data.tar.gz: ec03d303eb1d8b6dc3149085f0c7d767c3534771
3
+ metadata.gz: b60ad6d482d18e2d40a70301324c8cef58e42540
4
+ data.tar.gz: 823a4469928412bce019d15e2fcf5839472bd673
5
5
  SHA512:
6
- metadata.gz: 3964d3fe9f6b39a7ac276a9b19c98081096cc816582eafdd0c6f02e895a67c4418dda1469cde1a163606bca2f6fc6703133f78282f0f29b2f5a1eb5f335c09ec
7
- data.tar.gz: 8254e985f98a35672cc1a2dec4ee4dbc9540e8a1f87af42e0bd6badda497273b7c6198271d52307c574ff4439a038db81f020fdbca983fc9c385acf164211180
6
+ metadata.gz: d36e0f24a4d4248bd8a06a11b0f0ab6a22aabf599408451ebf4da2a952cea8c8cb7cd80cba9a85f944d68ae309d2a4754ecabad5447371908360cfbfea9fc5d5
7
+ data.tar.gz: 7cb327430ce86a0707af18c895698abf9479fec7e81dae84a136a5b93c31e454f6dad8b1c4342d2820b7342ac20f7d3a068754b80eb51b829502cd73f538cfe1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- newrelic-rmq-plugin (0.1.2)
4
+ newrelic-rmq-plugin (0.1.3)
5
5
  mixlib-cli (~> 1.7)
6
6
  newrelic_plugin
7
7
  rabbitmq_manager (~> 0.3.0)
@@ -35,6 +35,9 @@ module NewRelicRMQPlugin
35
35
 
36
36
  # => Grab Environment Information
37
37
  env_status
38
+
39
+ # => Reset
40
+ @overview = nil
38
41
  end
39
42
 
40
43
  private
@@ -45,15 +48,15 @@ module NewRelicRMQPlugin
45
48
 
46
49
  # => Global Metrics
47
50
  def global_metrics # rubocop: disable AbcSize
48
- report_metric 'Global Queue Size/Total', 'messages', rmq_manager.overview['queue_totals']['messages'] || 0
49
- report_metric 'Global Queue Size/Ready', 'messages', rmq_manager.overview['queue_totals']['messages_ready'] || 0
50
- report_metric 'Global Queue Size/Unacked', 'messages', rmq_manager.overview['queue_totals']['messages_unacknowledged'] || 0
51
+ report_metric 'Global Queue Size/Total', 'messages', overview['queue_totals']['messages']
52
+ report_metric 'Global Queue Size/Ready', 'messages', overview['queue_totals']['messages_ready']
53
+ report_metric 'Global Queue Size/Unacked', 'messages', overview['queue_totals']['messages_unacknowledged']
51
54
 
52
55
  report_metric 'Global Message Rate/Deliver', 'messages/sec', rate_for('deliver')
53
56
  report_metric 'Global Message Rate/Acknowledge', 'messages/sec', rate_for('ack')
54
57
  report_metric 'Global Message Rate/Return', 'messages/sec', rate_for('return_unroutable')
55
58
 
56
- rmq_manager.overview['object_totals'].each do |obj|
59
+ overview['object_totals'].each do |obj|
57
60
  report_metric "Global Object Totals/#{obj[0].capitalize}", nil, obj[1]
58
61
  end
59
62
  end
@@ -75,13 +78,14 @@ module NewRelicRMQPlugin
75
78
 
76
79
  # => RabbitMQ Configuration Status
77
80
  def env_status
78
- report_metric 'Status/Version', nil, rmq_manager.overview['rabbitmq_version']
79
- report_metric 'Status/Erlang Version', nil, rmq_manager.overview['erlang_version']
81
+ report_metric 'Status/Version', nil, overview['rabbitmq_version']
82
+ report_metric 'Status/Erlang Version', nil, overview['erlang_version']
80
83
  end
81
84
 
82
85
  #
83
86
  # => Helper Methods
84
87
  #
88
+
85
89
  def per_queue_rate_for(type, queue)
86
90
  msg_stats = queue['message_stats']
87
91
 
@@ -104,10 +108,19 @@ module NewRelicRMQPlugin
104
108
  end
105
109
  end
106
110
 
111
+ #
112
+ # => RabbitMQ
113
+ #
114
+
107
115
  # => Define the RabbitMQ Connection
108
116
  def rmq_manager
109
117
  @rmq_manager ||= ::RabbitMQManager.new(management_api_url, verify: verify_ssl)
110
118
  end
119
+
120
+ # => Only pull this once per Poll Cycle
121
+ def overview
122
+ @overview ||= rmq_manager.overview
123
+ end
111
124
  end
112
125
 
113
126
  # => Register the Agent
@@ -1,3 +1,3 @@
1
1
  module NewRelicRMQPlugin
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-rmq-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dwyer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-10 00:00:00.000000000 Z
11
+ date: 2016-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: newrelic_plugin