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 +4 -4
- data/lib/ocular/logging/kafka_logger.rb +4 -9
- data/lib/ocular/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82831750c3180b469b112e913d68172e1dbf136a
|
4
|
+
data.tar.gz: 1e191fad3b29b5dfb1e2968613263223f4a48b91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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}"
|
data/lib/ocular/version.rb
CHANGED