droonga-client 0.1.9 → 0.2.0

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: b93424bbf1204f04881870bed8343e65072ee30f
4
- data.tar.gz: 264ed3acb88d12ae24c6828f31c1f056bca0b1cf
3
+ metadata.gz: ee9432ca6044b36092942ac41aa627930b7b9d9a
4
+ data.tar.gz: a6f8e194ccad61f14f5f270e57994a69fdfc5fe5
5
5
  SHA512:
6
- metadata.gz: 9b7558962c63b1faa32cc1717abd224cfe8d4fdfa41723c5186914cf70421ee6ebd66df4b12a94cbaf43cb4cc837eb4124f5294d7810032a3efcb2636c516782
7
- data.tar.gz: 1308a45eaeb3a71d269d45a1c17aa0bf3629fffc83c3f10f112d7bbbd4d69e65e1ecd90b9d881845011d13ed70b7bb185af4c43432f40d0a7e048898e8e60bc1
6
+ metadata.gz: 11b805404b3bffee885633090fdde5cee4966e4cf27d0ec781770d1e6c50a488715500c6cc2c0a6cab657eef3d86563b8bbf7ea0eece59abbc650567b645c90e
7
+ data.tar.gz: 2966e8a79f03671b924d2d1214ec5ea1f990e3ccf9fa7138a78b768036c78e1f799258c19234ca3eb587211971a39272553ca83cd9a64a81b5ddf24720e14bf6
data/bin/droonga-send CHANGED
@@ -31,7 +31,7 @@ options.default_tag = "droonga"
31
31
 
32
32
  servers = []
33
33
  default_server = "droonga:localhost:10031/droonga"
34
- messages_per_second = Droonga::Client::RateLimiter::NO_LIMIT
34
+ messages_per_second = Droonga::Client::RateLimiter::DEFAULT_LIMIT
35
35
 
36
36
  def parse_server(server, options)
37
37
  server_matcher = /\A(?:(droonga|http):)?([^:]+)(?::([0-9]+))?(?:\/(.+))?\z/
@@ -141,6 +141,9 @@ end
141
141
  request_json_files = parser.parse!(ARGV)
142
142
 
143
143
  servers << default_server if servers.empty?
144
+ if messages_per_second > 0 and servers.size > 1
145
+ messages_per_second = messages_per_second / servers.size
146
+ end
144
147
  clients = servers.collect do |server|
145
148
  client_options = parse_server(server, options)
146
149
  client = Droonga::Client.new(client_options)
data/doc/text/news.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # News
2
2
 
3
- ## 0.1.9: 2014-07-29 (planned)
3
+ ## 0.2.0: 2014-11-29
4
+
5
+ * droonga-send:
6
+ * Restrict the number of sending messages per second to 100 by default.
7
+ Too many inpouring messages will make the cluster overflowed.
8
+ * Calculate suitable limitation about number of sending messages per second
9
+ for each endpoint, based on `--messages-per-second`.
10
+ In old versions, actually too many messages are sent to the cluster
11
+ because the limit affected for each node. (So, even if you specify `100`,
12
+ actually 300 messages were possibly sent when there are three endpoints.)
13
+
14
+ ## 0.1.9: 2014-07-29
4
15
 
5
16
  * droonga-send: Accept default protocol, port, and tag. Now you can omit them for the `--server` option.
6
17
 
@@ -51,9 +62,9 @@
51
62
  ### Improvements
52
63
 
53
64
  * droonga-protocol: Removed needless `statusCode` parameter from request.
54
- * droonga-protocol: Renamed {Droonga::Client#execute} to
65
+ * droonga-protocol: Renamed `Droonga::Client#execute` to
55
66
  {Droonga::Client#request}. This is incompatible change.
56
- * droonga-protocol: Removed {Droonga::Client#search} because it is
67
+ * droonga-protocol: Removed `Droonga::Client#search` because it is
57
68
  not useful.
58
69
  * droonga-protocol: Changed to use `Socket.gethostname` as the
59
70
  default receiver host instead of `0.0.0.0`.
@@ -29,6 +29,7 @@ module Droonga
29
29
  # finished.
30
30
  #
31
31
  # @param (see #initialize)
32
+ # @option (see #initialize)
32
33
  #
33
34
  # @yield [client] Gives the opened client. It is alive while yielding.
34
35
  # @yieldparam client [Client] The opened client.
@@ -125,7 +125,7 @@ module Droonga
125
125
  # Sends low level request. Normally, you should use other
126
126
  # convenience methods.
127
127
  #
128
- # @param envelope [Hash] Request envelope.
128
+ # @param message [Hash] Request message.
129
129
  # @param options [Hash] The options to send request.
130
130
  # TODO: WRITE ME
131
131
  # @return [void]
@@ -16,6 +16,7 @@
16
16
  module Droonga
17
17
  class Client
18
18
  class RateLimiter
19
+ DEFAULT_LIMIT = 100
19
20
  NO_LIMIT = -1
20
21
 
21
22
  def initialize(client, messages_per_second)
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Droonga
19
19
  class Client
20
- VERSION = "0.1.9"
20
+ VERSION = "0.2.0"
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: droonga-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Droonga Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-29 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.0.14
174
+ rubygems_version: 2.4.1
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Droonga client for Ruby