fluent-plugin-light-core 0.1.5 → 0.1.6

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: f004cf6d8d97f901c4844c3647851a87bb82a8c7a5a79d91e2b96a93d10d1491
4
- data.tar.gz: ff0875f99a288814f35024f4f4bc27853d88bc6865be5dee581767be314f079f
3
+ metadata.gz: 84773035328d3e9f94b3a41242a24038c9f00bf84ff4e4c282ac67d44fa75350
4
+ data.tar.gz: 393720c2ce0fc4d55fabf7e9206ab57bf8085c0df9c5e043356cc87f356328c4
5
5
  SHA512:
6
- metadata.gz: 81110b161c91e19ce471bda0c59302e0f48a5a73d6eb796fba37b6fe6dcd7e7b7dc50898dd071d9e079479bb202e38aa92aaa16ed072f2d26938951d292c456c
7
- data.tar.gz: fe794d6241d5c13395a6d6304527ec9aa4fcdc8839440f5df6602c653d25947646779edc4326e98a5a2b688318848e82a9ebf34ff80f30374c94952b63164400
6
+ metadata.gz: eca26afd55eb797b228c2cf65653882d31718c66630041ab05243c5be3d1b85f995a8dca5c8e6cd79971cb4db5735cd2d49ccb8f0e4c9357117e90252fae81ea
7
+ data.tar.gz: 8faa457619809fe3b26db9658fdf5dc66a960477541bc9ac7342b21612eb649743ec99be49ba1584e01fb8e615cd97f94dc9be9303d01fe222ed5ac654665226
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-light-core"
6
- spec.version = "0.1.5"
6
+ spec.version = "0.1.6"
7
7
  spec.authors = ["LIN LI"]
8
8
  spec.email = ["l.li@alphabets.cn"]
9
9
 
@@ -127,9 +127,9 @@ module Fluent
127
127
  record['method'] = item[:method]
128
128
  record['url'] = item[:url]
129
129
  record['status'] = item[:status]
130
- record['size'] = item[:size]
130
+ record['size'] = format_str(item[:size])
131
131
  record['uid'] = item[:uid]
132
- record['elapsed'] = item[:elapsed]
132
+ record['elapsed'] = format_str(item[:elapsed])
133
133
  record['addr'] = item[:addr].gsub(/\n$/, '')
134
134
 
135
135
  return record
@@ -166,11 +166,11 @@ module Fluent
166
166
  record['method'] = item[:method]
167
167
  record['path'] = item[:path]
168
168
  record['code'] = item[:code]
169
- record['size'] = item[:size]
169
+ record['size'] = format_str(item[:size])
170
170
  record['referer'] = item[:referer]
171
171
  record['agent'] = item[:agent]
172
172
  record['forwarder'] = item[:forwarder]
173
- record['elapsed'] = item[:elapsed]
173
+ record['elapsed'] = format_str(item[:elapsed])
174
174
 
175
175
  return record
176
176
  end
@@ -235,7 +235,7 @@ module Fluent
235
235
  end
236
236
 
237
237
  if item[:querytime]
238
- record['querytime'] = item[:querytime]
238
+ record['querytime'] = format_str(item[:querytime])
239
239
  end
240
240
 
241
241
  if item[:query]
@@ -331,6 +331,13 @@ module Fluent
331
331
  @udp.send(data.to_json, 0, Socket.pack_sockaddr_in(@port, @host))
332
332
  end
333
333
 
334
+ # 转数字
335
+ def format_str(str)
336
+ return str.to_i if (str =~ /^\d+$/)
337
+ return str.to_f if (str =~ /^\d+\.\d+$/)
338
+ str
339
+ end
340
+
334
341
  end
335
342
  end
336
343
  end
@@ -21,7 +21,10 @@ Initialized empty Git repository in /Users/lilin/developer/light/fluent-plugin-l
21
21
  % gem signin
22
22
 
23
23
  - 发布
24
- rake release
24
+ 1. 删除pkg目录下的所有内容
25
+ 2. 修改 fluent-plugin-light-core.gemspec 中的 spec.version
26
+ 3. 提交所有的修改
27
+ 4. 执行打包发布 $ rake release
25
28
 
26
29
 
27
30
  ## 调试
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-light-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - LIN LI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-06 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler