ocular 0.2.6 → 0.2.7

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: f6b417bff05762b7e15a5dcc2dad418b5e31b224
4
- data.tar.gz: fc7391ab1ac121832c29627712830a1447bca5e8
3
+ metadata.gz: 82831750c3180b469b112e913d68172e1dbf136a
4
+ data.tar.gz: 1e191fad3b29b5dfb1e2968613263223f4a48b91
5
5
  SHA512:
6
- metadata.gz: 7b2d2092d6d8391456907c4323cd636bc73746840865c91fbbf5caff9ef6c12f04f1674993065d7fd0a1490e7f64d2a37812b6e71e230b352df4749c56881b78
7
- data.tar.gz: 26d6329a5b56c07807e8125f6c3a9874c76721d71bd04d1bd64e5408a75262a87e75be2824c34ab06a76b39a904458b04538c57742fcc769e2cf8b14e88be84a
6
+ metadata.gz: 4dc7b0ff8f04ea6232b4f3262a51a18ae3a796872dee5662455d21539cfef51781e48180c6a356d4400541f657daedd38a4e594b01bfdd038e523c629f2f5e63
7
+ data.tar.gz: 3674936a6c26166b991738bf29193235afda817338497ac38cabe2b0017ff22f9548b234c02ad1d74eab7fa3296a17cb98619d54077a3e7fc43a5d265c0d715a
@@ -24,7 +24,6 @@ class Ocular
24
24
  @settings = settings
25
25
 
26
26
  @producer = @kafka.producer
27
-
28
27
  @semaphore = Mutex.new
29
28
  end
30
29
 
@@ -75,8 +74,7 @@ class Ocular
75
74
 
76
75
  begin
77
76
  @semaphore.synchronize do
78
- @producer.produce(@formatter.format_message(severity, Time.now, run_id, message), topic: @settings[:topic], partition_key: run_id)
79
- deliver_messages()
77
+ @kafka.deliver_message(@formatter.format_message(severity, Time.now, run_id, message), topic: @settings[:topic], partition_key: run_id)
80
78
  end
81
79
  rescue StandardError => e
82
80
  STDERR.puts "Error on producing kafka message: #{e}"
@@ -87,8 +85,7 @@ class Ocular
87
85
  def log_event(property, value, run_id = nil)
88
86
  begin
89
87
  @semaphore.synchronize do
90
- @producer.produce(@formatter.format_event(property, value, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
91
- deliver_messages()
88
+ @kafka.deliver_message(@formatter.format_event(property, value, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
92
89
  end
93
90
  rescue StandardError => e
94
91
  STDERR.puts "Error on producing kafka log_event: #{e}"
@@ -99,8 +96,7 @@ class Ocular
99
96
  def log_cause(type, environment, run_id = nil)
100
97
  begin
101
98
  @semaphore.synchronize do
102
- @producer.produce(@formatter.format_cause(type, environment, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
103
- deliver_messages()
99
+ @kafka.deliver_message(@formatter.format_cause(type, environment, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
104
100
  end
105
101
  rescue StandardError => e
106
102
  STDERR.puts "Error on producing kafka log_cause: #{e}"
@@ -112,8 +108,7 @@ class Ocular
112
108
  def log_timing(key, value, run_id = nil)
113
109
  begin
114
110
  @semaphore.synchronize do
115
- @producer.produce(@formatter.format_event("timing:" + key, value, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
116
- deliver_messages()
111
+ @kafka.deliver_message(@formatter.format_event("timing:" + key, value, Time.now, run_id), topic: @settings[:topic], partition_key: run_id)
117
112
  end
118
113
  rescue StandardError => e
119
114
  STDERR.puts "Error on producing kafka log_timing: #{e}"
@@ -1,3 +1,3 @@
1
1
  class Ocular
2
- Version = "0.2.6"
2
+ Version = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juho Mäkinen