deimos-kafka 1.0.0.pre.beta17 → 1.0.0.pre.beta18

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: 30b4706911af70b7e4662afdecf5b547583b74dbdebce492a7e57a9b1c9d504e
4
- data.tar.gz: d5583aefa2e976497d8190398f0b04b2d07e33f6ff8f5ac79089bffa850b53f9
3
+ metadata.gz: aa0b3386a91de8df444dc0dd95daa79965dd2458d7f76088ce9f3aab9812838e
4
+ data.tar.gz: 59ac90f569462a2493e3ecf7920a1114ff275db52bda1f2ac0f4777828cc3b97
5
5
  SHA512:
6
- metadata.gz: 329ad07cc57cc869c1f9a843d74f70a428c7706882ce5bcabe8006afbc0e557f5931649ea4871973d21b5edd8d5e892dcf82ae5e0231a21e8b6e8021c2da187c
7
- data.tar.gz: dc46360e6061b586b127888ac784b946fde6e9e5efe73173b8963aa1345fd65b58fe174e4fc69db37d9093ef17549c436087e1d35a73df555135c1d430f19a3b
6
+ metadata.gz: 1c5ec5ccba522c2e668cb71e4d46254eacf8af7c190918567e62b70924cf1d382f5a03ce75df9ea2f8f5e5d55a66f34d259d702419f3620891d1c1d421c00531
7
+ data.tar.gz: 39644011b97084a32ec248ad7fc39c068c10b0d199744e6a8d2a47f82606093c05a242388a32a90464078abcdecb08df0e186061266a00d6589ddf2eb3cf737e
data/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.0-beta18] - 2019-08-02
9
+ - Fixed crash when sending metrics in a couple of places.
10
+
8
11
  ## [1.0.0-beta17] - 2019-07-31
9
12
  - Added `rails deimos:db_producer` rake task.
10
13
  - Fixed the DB producer so it runs inline instead of on a separate thread.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deimos-kafka (1.0.0.pre.beta17)
4
+ deimos-kafka (1.0.0.pre.beta18)
5
5
  avro-patches (~> 0.3)
6
6
  avro_turf (~> 0.8)
7
7
  phobos (~> 1.8)
@@ -29,8 +29,8 @@ GEM
29
29
  multi_json
30
30
  avro-patches (0.4.1)
31
31
  avro (= 1.8.2)
32
- avro_turf (0.8.1)
33
- avro (>= 1.7.7, < 1.9)
32
+ avro_turf (0.9.0)
33
+ avro (>= 1.7.7, < 1.10)
34
34
  excon (~> 0.45)
35
35
  coderay (1.1.2)
36
36
  concurrent-ruby (1.1.3)
@@ -41,7 +41,7 @@ GEM
41
41
  diff-lcs (1.3)
42
42
  digest-crc (0.4.1)
43
43
  dogstatsd-ruby (4.2.0)
44
- excon (0.64.0)
44
+ excon (0.65.0)
45
45
  exponential-backoff (0.0.2)
46
46
  ffi (1.11.1)
47
47
  formatador (0.2.5)
@@ -127,7 +127,7 @@ GEM
127
127
  unicode-display_width (>= 1.4.0, < 1.7)
128
128
  rubocop-rspec (1.32.0)
129
129
  rubocop (>= 0.60.0)
130
- ruby-kafka (0.7.8)
130
+ ruby-kafka (0.7.9)
131
131
  digest-crc
132
132
  ruby-progressbar (1.10.1)
133
133
  ruby_dep (1.5.0)
data/lib/deimos.rb CHANGED
@@ -78,12 +78,12 @@ module Deimos
78
78
  # Start the DB producers to send Kafka messages.
79
79
  # @param thread_count [Integer] the number of threads to start.
80
80
  def start_db_backend!(thread_count: 1)
81
- if self.config.publish_backend != :db
82
- raise("Publish backend is not set to :db, exiting")
81
+ if self.config.publish_backend != :db # rubocop:disable Style/IfUnlessModifier
82
+ raise('Publish backend is not set to :db, exiting')
83
83
  end
84
84
 
85
85
  if thread_count.nil? || thread_count.zero?
86
- raise("Thread count is not given or set to zero, exiting")
86
+ raise('Thread count is not given or set to zero, exiting')
87
87
  end
88
88
 
89
89
  producers = (1..thread_count).map do
@@ -51,8 +51,8 @@ module Deimos
51
51
  producer = batch.first.metadata[:producer_name]
52
52
  payloads = batch.map { |m| m.metadata[:decoded_payload] }
53
53
 
54
- Deimos.metrics&.count('publish_error', payloads.size,
55
- tags: %W(topic:#{topic}))
54
+ Deimos.config.metrics&.count('publish_error', payloads.size,
55
+ tags: %W(topic:#{topic}))
56
56
  Deimos.instrument(
57
57
  'produce_error',
58
58
  producer: producer,
@@ -83,7 +83,7 @@ module Deimos
83
83
  def produce_messages(batch)
84
84
  @logger.debug("Publishing #{batch.size} messages to #{@current_topic}")
85
85
  producer.publish_list(batch)
86
- Deimos.metrics&.increment(
86
+ Deimos.config.metrics&.increment(
87
87
  'publish',
88
88
  tags: %W(status:success topic:#{@current_topic}),
89
89
  by: batch.size
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deimos
4
- VERSION = '1.0.0-beta17'
4
+ VERSION = '1.0.0-beta18'
5
5
  end
@@ -10,7 +10,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
10
10
 
11
11
  add_index :kafka_messages, [:topic, :id]
12
12
 
13
- create_table :kafka_topic_info, force: true do |t|
13
+ create_table :kafka_topic_info, force: true do |t| # rubocop:disable Rails/CreateTableWithTimestamps
14
14
  t.string :topic, null: false
15
15
  t.string :locked_by
16
16
  t.datetime :locked_at
@@ -10,7 +10,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
10
10
 
11
11
  add_index :kafka_messages, [:topic, :id]
12
12
 
13
- create_table :kafka_topic_info, force: true do |t|
13
+ create_table :kafka_topic_info, force: true do |t| # rubocop:disable Rails/CreateTableWithTimestamps
14
14
  t.string :topic, null: false
15
15
  t.string :locked_by
16
16
  t.datetime :locked_at
@@ -19,7 +19,7 @@ namespace :deimos do
19
19
  task db_producer: :environment do
20
20
  ENV['DEIMOS_RAKE_TASK'] = 'true'
21
21
  STDOUT.sync = true
22
- Rails.logger.info("Running deimos:db_producer rake task.")
22
+ Rails.logger.info('Running deimos:db_producer rake task.')
23
23
  thread_count = ENV['THREADS'].presence || 1
24
24
  Deimos.start_db_backend!(thread_count: thread_count)
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deimos-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta17
4
+ version: 1.0.0.pre.beta18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-31 00:00:00.000000000 Z
11
+ date: 2019-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avro-patches