fluent-plugin-cloud-pubsub 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2e73ecd93f477db47b6b65460ae859d9866d488
4
- data.tar.gz: 153f860d1f0f481a3b140042c831ad8a8976ecf8
3
+ metadata.gz: 5aa75a3d6f7d3a0d6281af752370e0cb3a9d69e3
4
+ data.tar.gz: 03a18a7d7e8631513b36b9405737c10472d24843
5
5
  SHA512:
6
- metadata.gz: bb3779c706f2cbaebb60eca80c9ed251aafe2bd3da4322a84f8148731351023ed963fd9420813976586b542666e73f1343ed8ccb9e75fcad194a293fe9633223
7
- data.tar.gz: 615977a94d7de3a796ecf8697f09d3bfd4b5f6c6d9a87ef37e2a94ebcccbfa5598bdb5b323205c9eb76297a7cecb20cc627ce4d324e98032a15c96442742da18
6
+ metadata.gz: e5af45cd0e118cf1b5acc0f7c92e964781bf8c73cb361791ef02a901b531a1013b421f4bd373435aa998e6640b83a45cab84f338b597d960926df7c624064a79
7
+ data.tar.gz: b91350c73f8adbdd81745214693d59002ff70199c598ccacc6a4624296ca7e656ad6dafd8f0cefad5068c849256a2725d670174c194796498506b12a664ecef7
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.license = "MIT"
8
8
  gem.homepage = "https://github.com/yosssi/fluent-plugin-cloud-pubsub"
9
9
  gem.summary = gem.description
10
- gem.version = "0.0.1"
10
+ gem.version = "0.0.2"
11
11
  gem.authors = ["Keiji Yoshida"]
12
12
  gem.email = "yoshida.keiji.84@gmail.com"
13
13
  gem.has_rdoc = false
@@ -40,13 +40,23 @@ module Fluent
40
40
  [tag, time, record].to_msgpack
41
41
  end
42
42
 
43
+ def publish(msgs)
44
+ log.debug "publish #{msgs.length} messages"
45
+
46
+ @client.publish do |batch|
47
+ msgs.each do |m|
48
+ batch.publish m
49
+ end
50
+ end
51
+ end
52
+
43
53
  def write(chunk)
44
54
  msgs = []
45
55
  msgs_size = 0
46
56
 
47
57
  chunk.msgpack_each do |tag, time, record|
48
58
  size = Yajl.dump(record).bytesize
49
- if msgs.length > 0 && (msgs_size + size > max_req_size || msgs.length + 1 > max_msgs_per_req)
59
+ if msgs.length > 0 && (msgs_size + size > @max_req_size || msgs.length + 1 > @max_msgs_per_req)
50
60
  publish(msgs)
51
61
  msgs = []
52
62
  msgs_size = 0
@@ -64,11 +74,4 @@ module Fluent
64
74
  end
65
75
  end
66
76
 
67
- def publish(msgs)
68
- @client.publish do |batch|
69
- msgs.each do |m|
70
- batch.publish m
71
- end
72
- end
73
- end
74
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloud-pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiji Yoshida