alephant-publisher-queue 1.3.3 → 1.3.4

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: d9044e54c7ba56d24485a62166bfb407d531e73c
4
- data.tar.gz: 64270ea87f8d19040fda732df586d4e2827ad1f6
3
+ metadata.gz: 170dfdb0c98c4b04de1bae7ae06f21f3109586d4
4
+ data.tar.gz: 6a1b78a2a4b8c074abc62c5b3b76d2201e95c142
5
5
  SHA512:
6
- metadata.gz: 1334ae4fb5c1f474a1bd66e77fe69cddc02d0bcfafeca9068d309a914b2e86a91e0e44e5ad2c6fa34ad2d5bd5285cfb6409d16a314b81ebf5ed0340288990fb0
7
- data.tar.gz: c7fed205a6f3f9ce81e266cc87944c6b9e5e250b8527dd23f033c3e01256eeda41b595efaf96288ce8d3accb0c9e440f461477a454f3775e6f346d40f69d5c1b
6
+ metadata.gz: 48b6e0264f643e7b10356d2062bd310e90faef7b29a3bfd4baf27797ce2800f40dffc1213e9cb4695cceedac2720c2cfdda7d743a55d4043816eb2d2491cee7d
7
+ data.tar.gz: 066dfdefded32d10469651270942ecfb60656ced55eb69caa1f0a8f9824830ced29dc395560cae1dedeb7632c9478c98d660179cfce6e32d360939065061c799
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency 'alephant-support'
35
35
  spec.add_runtime_dependency 'alephant-sequencer'
36
36
  spec.add_runtime_dependency 'alephant-cache'
37
- spec.add_runtime_dependency 'alephant-logger'
37
+ spec.add_runtime_dependency 'alephant-logger', "1.2.0"
38
38
  spec.add_runtime_dependency 'alephant-lookup'
39
39
  spec.add_runtime_dependency 'alephant-renderer'
40
40
  end
@@ -49,12 +49,22 @@ module Alephant
49
49
  validate type, opts
50
50
  instance.merge! opts
51
51
  rescue Exception => e
52
- logger.metric(:name => "PublisherQueueOptionsInvalidKeySpecified", :unit => "Count", :value => 1)
52
+ logger.metric("PublisherQueueOptionsInvalidKeySpecified", opts)
53
53
  logger.error "Publisher::Queue::Options#validate: '#{e.message}'"
54
54
  puts e.message
55
55
  end
56
56
  end
57
57
 
58
+ def opts
59
+ {
60
+ :dimensions => {
61
+ :module => "AlephantPublisherQueue",
62
+ :class => "Options",
63
+ :function => "execute"
64
+ }
65
+ }
66
+ end
67
+
58
68
  def validate(type, opts)
59
69
  opts.each do |key, value|
60
70
  raise InvalidKeySpecifiedError, "The key '#{key}' is invalid" unless type.include? key.to_sym
@@ -24,15 +24,30 @@ module Alephant
24
24
 
25
25
  def async_store(m)
26
26
  Thread.new { store(m) }
27
- logger.metric(:name => "PublisherQueueSQSHelperAsynchronouslyArchivedData", :unit => "Count", :value => 1)
27
+ logger.metric(
28
+ "AsynchronouslyArchivedData",
29
+ opts[:dimensions].merge(:function => "async_store")
30
+ )
28
31
  end
29
32
 
30
33
  def store(m)
31
- logger.metric(:name => "PublisherQueueSQSHelperSynchronouslyArchivedData", :unit => "Count", :value => 1)
34
+ logger.metric(
35
+ "SynchronouslyArchivedData",
36
+ opts[:dimensions].merge(:function => "store")
37
+ )
32
38
  logger.info "Publisher::Queue::SQSHelper::Archiver#store: '#{m.body}' at 'archive/#{date_key}/#{m.id}'"
33
39
  cache.put("archive/#{date_key}/#{m.id}", m.body, meta_for(m))
34
40
  end
35
41
 
42
+ def opts
43
+ {
44
+ :dimensions => {
45
+ :module => "AlephantPublisherQueueSQSHelper",
46
+ :class => "Archiver"
47
+ }
48
+ }
49
+ end
50
+
36
51
  def date_key
37
52
  DateTime.now.strftime('%d-%m-%Y_%H')
38
53
  end
@@ -29,7 +29,10 @@ module Alephant
29
29
  private
30
30
 
31
31
  def process(m)
32
- logger.metric(:name => "PublisherQueueSQSHelperMessagesReceived", :unit => "Count", :value => 1)
32
+ logger.metric(
33
+ "MessagesReceived",
34
+ opts[:dimensions].merge(:function => "process")
35
+ )
33
36
  logger.info("Queue#message: received #{m.id}")
34
37
  archive m
35
38
  end
@@ -37,7 +40,10 @@ module Alephant
37
40
  def archive(m)
38
41
  archiver.see(m) unless archiver.nil?
39
42
  rescue StandardError => e
40
- logger.metric(:name => "PublisherQueueSQSHelperArchiveFailed", :unit => "Count", :value => 1)
43
+ logger.metric(
44
+ "ArchiveFailed",
45
+ opts[:dimensions].merge(:function => "archive")
46
+ )
41
47
  logger.warn("Queue#archive: archive failed (#{e.message})");
42
48
  end
43
49
 
@@ -47,6 +53,15 @@ module Alephant
47
53
  :wait_time_seconds => wait_time
48
54
  })
49
55
  end
56
+
57
+ def opts
58
+ {
59
+ :dimensions => {
60
+ :module => "PublisherQueueSQSHelper",
61
+ :class => "Queue"
62
+ }
63
+ }
64
+ end
50
65
  end
51
66
  end
52
67
  end
@@ -1,7 +1,7 @@
1
1
  module Alephant
2
2
  module Publisher
3
3
  module Queue
4
- VERSION = "1.3.3"
4
+ VERSION = "1.3.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,267 +1,267 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-publisher-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - revett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.5'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - ~>
23
17
  - !ruby/object:Gem::Version
24
18
  version: '1.5'
19
+ name: bundler
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - ~>
32
25
  - !ruby/object:Gem::Version
33
- version: '0'
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - '>='
37
31
  - !ruby/object:Gem::Version
38
32
  version: '0'
33
+ name: rspec
39
34
  prerelease: false
40
35
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: rspec-nc
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
38
  - - '>='
46
39
  - !ruby/object:Gem::Version
47
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
48
42
  requirement: !ruby/object:Gem::Requirement
49
43
  requirements:
50
44
  - - '>='
51
45
  - !ruby/object:Gem::Version
52
46
  version: '0'
47
+ name: rspec-nc
53
48
  prerelease: false
54
49
  type: :development
55
- - !ruby/object:Gem::Dependency
56
- name: guard
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
51
  requirements:
59
52
  - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
62
56
  requirement: !ruby/object:Gem::Requirement
63
57
  requirements:
64
58
  - - '>='
65
59
  - !ruby/object:Gem::Version
66
60
  version: '0'
61
+ name: guard
67
62
  prerelease: false
68
63
  type: :development
69
- - !ruby/object:Gem::Dependency
70
- name: guard-rspec
71
64
  version_requirements: !ruby/object:Gem::Requirement
72
65
  requirements:
73
66
  - - '>='
74
67
  - !ruby/object:Gem::Version
75
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
76
70
  requirement: !ruby/object:Gem::Requirement
77
71
  requirements:
78
72
  - - '>='
79
73
  - !ruby/object:Gem::Version
80
74
  version: '0'
75
+ name: guard-rspec
81
76
  prerelease: false
82
77
  type: :development
83
- - !ruby/object:Gem::Dependency
84
- name: pry
85
78
  version_requirements: !ruby/object:Gem::Requirement
86
79
  requirements:
87
80
  - - '>='
88
81
  - !ruby/object:Gem::Version
89
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
90
84
  requirement: !ruby/object:Gem::Requirement
91
85
  requirements:
92
86
  - - '>='
93
87
  - !ruby/object:Gem::Version
94
88
  version: '0'
89
+ name: pry
95
90
  prerelease: false
96
91
  type: :development
97
- - !ruby/object:Gem::Dependency
98
- name: pry-remote
99
92
  version_requirements: !ruby/object:Gem::Requirement
100
93
  requirements:
101
94
  - - '>='
102
95
  - !ruby/object:Gem::Version
103
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
104
98
  requirement: !ruby/object:Gem::Requirement
105
99
  requirements:
106
100
  - - '>='
107
101
  - !ruby/object:Gem::Version
108
102
  version: '0'
103
+ name: pry-remote
109
104
  prerelease: false
110
105
  type: :development
111
- - !ruby/object:Gem::Dependency
112
- name: pry-nav
113
106
  version_requirements: !ruby/object:Gem::Requirement
114
107
  requirements:
115
108
  - - '>='
116
109
  - !ruby/object:Gem::Version
117
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
118
112
  requirement: !ruby/object:Gem::Requirement
119
113
  requirements:
120
114
  - - '>='
121
115
  - !ruby/object:Gem::Version
122
116
  version: '0'
117
+ name: pry-nav
123
118
  prerelease: false
124
119
  type: :development
125
- - !ruby/object:Gem::Dependency
126
- name: rake-rspec
127
120
  version_requirements: !ruby/object:Gem::Requirement
128
121
  requirements:
129
122
  - - '>='
130
123
  - !ruby/object:Gem::Version
131
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
132
126
  requirement: !ruby/object:Gem::Requirement
133
127
  requirements:
134
128
  - - '>='
135
129
  - !ruby/object:Gem::Version
136
130
  version: '0'
131
+ name: rake-rspec
137
132
  prerelease: false
138
133
  type: :development
139
- - !ruby/object:Gem::Dependency
140
- name: rake
141
134
  version_requirements: !ruby/object:Gem::Requirement
142
135
  requirements:
143
136
  - - '>='
144
137
  - !ruby/object:Gem::Version
145
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
146
140
  requirement: !ruby/object:Gem::Requirement
147
141
  requirements:
148
142
  - - '>='
149
143
  - !ruby/object:Gem::Version
150
144
  version: '0'
145
+ name: rake
151
146
  prerelease: false
152
147
  type: :runtime
153
- - !ruby/object:Gem::Dependency
154
- name: aws-sdk
155
148
  version_requirements: !ruby/object:Gem::Requirement
156
149
  requirements:
157
- - - ~>
150
+ - - '>='
158
151
  - !ruby/object:Gem::Version
159
- version: '1.0'
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
160
154
  requirement: !ruby/object:Gem::Requirement
161
155
  requirements:
162
156
  - - ~>
163
157
  - !ruby/object:Gem::Version
164
158
  version: '1.0'
159
+ name: aws-sdk
165
160
  prerelease: false
166
161
  type: :runtime
167
- - !ruby/object:Gem::Dependency
168
- name: crimp
169
162
  version_requirements: !ruby/object:Gem::Requirement
170
163
  requirements:
171
- - - '>='
164
+ - - ~>
172
165
  - !ruby/object:Gem::Version
173
- version: '0'
166
+ version: '1.0'
167
+ - !ruby/object:Gem::Dependency
174
168
  requirement: !ruby/object:Gem::Requirement
175
169
  requirements:
176
170
  - - '>='
177
171
  - !ruby/object:Gem::Version
178
172
  version: '0'
173
+ name: crimp
179
174
  prerelease: false
180
175
  type: :runtime
181
- - !ruby/object:Gem::Dependency
182
- name: alephant-support
183
176
  version_requirements: !ruby/object:Gem::Requirement
184
177
  requirements:
185
178
  - - '>='
186
179
  - !ruby/object:Gem::Version
187
180
  version: '0'
181
+ - !ruby/object:Gem::Dependency
188
182
  requirement: !ruby/object:Gem::Requirement
189
183
  requirements:
190
184
  - - '>='
191
185
  - !ruby/object:Gem::Version
192
186
  version: '0'
187
+ name: alephant-support
193
188
  prerelease: false
194
189
  type: :runtime
195
- - !ruby/object:Gem::Dependency
196
- name: alephant-sequencer
197
190
  version_requirements: !ruby/object:Gem::Requirement
198
191
  requirements:
199
192
  - - '>='
200
193
  - !ruby/object:Gem::Version
201
194
  version: '0'
195
+ - !ruby/object:Gem::Dependency
202
196
  requirement: !ruby/object:Gem::Requirement
203
197
  requirements:
204
198
  - - '>='
205
199
  - !ruby/object:Gem::Version
206
200
  version: '0'
201
+ name: alephant-sequencer
207
202
  prerelease: false
208
203
  type: :runtime
209
- - !ruby/object:Gem::Dependency
210
- name: alephant-cache
211
204
  version_requirements: !ruby/object:Gem::Requirement
212
205
  requirements:
213
206
  - - '>='
214
207
  - !ruby/object:Gem::Version
215
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
216
210
  requirement: !ruby/object:Gem::Requirement
217
211
  requirements:
218
212
  - - '>='
219
213
  - !ruby/object:Gem::Version
220
214
  version: '0'
215
+ name: alephant-cache
221
216
  prerelease: false
222
217
  type: :runtime
223
- - !ruby/object:Gem::Dependency
224
- name: alephant-logger
225
218
  version_requirements: !ruby/object:Gem::Requirement
226
219
  requirements:
227
220
  - - '>='
228
221
  - !ruby/object:Gem::Version
229
222
  version: '0'
223
+ - !ruby/object:Gem::Dependency
230
224
  requirement: !ruby/object:Gem::Requirement
231
225
  requirements:
232
- - - '>='
226
+ - - '='
233
227
  - !ruby/object:Gem::Version
234
- version: '0'
228
+ version: 1.2.0
229
+ name: alephant-logger
235
230
  prerelease: false
236
231
  type: :runtime
237
- - !ruby/object:Gem::Dependency
238
- name: alephant-lookup
239
232
  version_requirements: !ruby/object:Gem::Requirement
240
233
  requirements:
241
- - - '>='
234
+ - - '='
242
235
  - !ruby/object:Gem::Version
243
- version: '0'
236
+ version: 1.2.0
237
+ - !ruby/object:Gem::Dependency
244
238
  requirement: !ruby/object:Gem::Requirement
245
239
  requirements:
246
240
  - - '>='
247
241
  - !ruby/object:Gem::Version
248
242
  version: '0'
243
+ name: alephant-lookup
249
244
  prerelease: false
250
245
  type: :runtime
251
- - !ruby/object:Gem::Dependency
252
- name: alephant-renderer
253
246
  version_requirements: !ruby/object:Gem::Requirement
254
247
  requirements:
255
248
  - - '>='
256
249
  - !ruby/object:Gem::Version
257
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
258
252
  requirement: !ruby/object:Gem::Requirement
259
253
  requirements:
260
254
  - - '>='
261
255
  - !ruby/object:Gem::Version
262
256
  version: '0'
257
+ name: alephant-renderer
263
258
  prerelease: false
264
259
  type: :runtime
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
265
  description: Static publishing to S3 based on SQS messages
266
266
  email:
267
267
  - charlierevett@gmail.com