franz 1.5.9 → 1.5.10

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: f1b893a08216930ae54c7bc089190ced39575a27
4
- data.tar.gz: a7bc30fcd0e71b6a0305f1532e1917e44898672e
3
+ metadata.gz: 4a2225626aaa28e072d55bcb249af3861f98473d
4
+ data.tar.gz: 6c0dca54875a2c75b4513cdf5b6af30542220c70
5
5
  SHA512:
6
- metadata.gz: 47c16c78ba9ee896c7e4628fb5e58ac93cb7ce51b8a707e3a275318b799179abeae57d60ff97d36405188e47ab3134bd0dbd2784dbeea81146f19467fe141193
7
- data.tar.gz: 5c8a3783775c21e0c43d3f2b96f7e5cb27b7eed0dafc05fa5d7bfe5508f768df29e33eec983b335cb1fc62999767edf142f44130c1f08309e185916bb53f93fc
6
+ metadata.gz: 922d78336e5f9fbf5964a9df7b28624f3c3fa1d0178b307595cefb0397d5c50cf89b5ff23536218fb0ba5fa22687841a89a389f397d6bc1135941d66ca1b57c0
7
+ data.tar.gz: 08204709d968ce6ff1f7bd5c1d8243f3e9437048f4510e1abca88160933760326360b3af9dd6e76da410de9ce833ab70af909a3e69cfe75a20aaa180f5a50ecd
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.9
1
+ 1.5.10
data/lib/franz/agg.rb CHANGED
@@ -109,12 +109,13 @@ module Franz
109
109
  s = seq path
110
110
  m = message.encode 'UTF-8', invalid: :replace, undef: :replace, replace: '?'
111
111
 
112
- event = { path: path, type: t, host: @@host, '@seq' => s }
112
+ event = { type: t, host: @@host, '@seq' => s }
113
+
113
114
  if @ic.json? path
114
115
  return if m =~ /^#/
115
- event.merge! JSON::parse(m)
116
+ event = JSON::parse(m).merge(event)
116
117
  else
117
- event.merge! message: m
118
+ event.merge! message: m, path: path
118
119
  end
119
120
  agg_events.push event
120
121
  end
data/lib/franz/tail.rb CHANGED
@@ -99,8 +99,13 @@ module Franz
99
99
 
100
100
  begin
101
101
  data = IO::read path, @block_size, @cursors[path]
102
- rescue EOFError, Errno::ENOENT
102
+ reason_for_nil_data = 'unknown'
103
+ rescue EOFError
103
104
  data = nil
105
+ reason_for_nil_data = 'eof'
106
+ rescue Errno::ENOENT
107
+ data = nil
108
+ reason_for_nil_data = 'noent'
104
109
  end
105
110
 
106
111
  if data.nil?
@@ -112,7 +117,8 @@ module Franz
112
117
  path: path,
113
118
  size: size,
114
119
  cursor: @cursors[path],
115
- spread: (size - @cursors[path])
120
+ spread: (size - @cursors[path]),
121
+ reason: reason_for_nil_data
116
122
  return
117
123
  end
118
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: franz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.9
4
+ version: 1.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer