stat-count-client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -4
- data/lib/stat-count-client/hessian_client.rb +3 -3
- data/lib/stat-count-client/thrift_client.rb +1 -1
- data/lib/stat-count-client/version.rb +1 -1
- data/test/{benchmark.rb → count_benchmark.rb} +7 -7
- data/test/stat_count_client_test.rb +1 -1
- data/test/thrift_count_client_test.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d95b353ad3c9ac711e411716e1ed330fe1650e4f
|
4
|
+
data.tar.gz: c60e9246ef4e97fb9c167e7b497c10f2b5c23421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb76df4a828457f0da348bb61b5b42e97ee5b26fcd5b473561e9d4675ec9c4490e91a012b9c57b209d4222ab646a7ded4b1e4e0e7cb9f367bdf55a4387429cb
|
7
|
+
data.tar.gz: e4fd9d7fcee4fac0fdd35a5f4bc94aff5041401db51c0752dfcf7d0bce8c67ee8da93839c960c445981fcfbbdb2b8ce0bf696f42600b896c79cdd9303e2f91c4
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,35 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stat-count-client (0.0.
|
5
|
-
|
4
|
+
stat-count-client (0.0.3)
|
5
|
+
em_hessian2
|
6
6
|
thrift-client
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
remote: http://192.168.3.220:9292/
|
11
11
|
specs:
|
12
|
+
addressable (2.3.5)
|
12
13
|
bigdecimal (1.2.1)
|
13
|
-
|
14
|
+
cookiejar (0.3.0)
|
15
|
+
em-http-request (1.1.0)
|
16
|
+
addressable (>= 2.3.4)
|
17
|
+
cookiejar
|
18
|
+
em-socksify (>= 0.3)
|
19
|
+
eventmachine (>= 1.0.3)
|
20
|
+
http_parser.rb (>= 0.6.0.beta.2)
|
21
|
+
em-socksify (0.3.0)
|
22
|
+
eventmachine (>= 1.0.0.beta.4)
|
23
|
+
em-synchrony (1.0.3)
|
24
|
+
eventmachine (>= 1.0.0.beta.1)
|
25
|
+
em_hessian2 (2.0.1)
|
14
26
|
bigdecimal
|
27
|
+
em-http-request
|
28
|
+
em-synchrony
|
29
|
+
eventmachine (1.0.3)
|
30
|
+
http_parser.rb (0.6.0.beta.2)
|
15
31
|
thrift (0.9.1)
|
16
|
-
thrift-client (0.0.
|
32
|
+
thrift-client (0.0.6)
|
17
33
|
thrift (~> 0.9.0)
|
18
34
|
|
19
35
|
PLATFORMS
|
@@ -22,7 +22,7 @@ module Stat
|
|
22
22
|
@hessian_url ||= ENV['stat.count.domain']
|
23
23
|
@hessian_url ||= CONFIG['hessian.domain']
|
24
24
|
end
|
25
|
-
init(
|
25
|
+
init()
|
26
26
|
end
|
27
27
|
|
28
28
|
def to_hash_unit(data)
|
@@ -163,8 +163,8 @@ module Stat
|
|
163
163
|
end
|
164
164
|
|
165
165
|
private
|
166
|
-
def init(
|
167
|
-
@@logger.info("Init Stat count client connect to hessian url: #{hessian_url}")
|
166
|
+
def init()
|
167
|
+
@@logger.info("Init Stat count client connect to hessian url: #{@hessian_url}")
|
168
168
|
begin
|
169
169
|
@client = Hessian2::HessianClient.new(@hessian_url)
|
170
170
|
rescue => err
|
@@ -5,7 +5,7 @@ require "stat-count-client/thrift/collecter_types"
|
|
5
5
|
require "stat-count-client/thrift/remote_simple_count_collecter"
|
6
6
|
require "stat-count-client/stat_count_data"
|
7
7
|
require "stat-count-client/logger_factory"
|
8
|
-
require "singleton"
|
8
|
+
# require "singleton"
|
9
9
|
|
10
10
|
module Stat
|
11
11
|
module Count
|
@@ -7,17 +7,17 @@ require "stat-count-client"
|
|
7
7
|
require_relative "count_mother"
|
8
8
|
require 'benchmark'
|
9
9
|
|
10
|
-
iterations =
|
10
|
+
iterations = 10000
|
11
11
|
def reset(client)
|
12
12
|
client.reset("test", "1")
|
13
13
|
client.reset("testHour", "2")
|
14
14
|
client.reset("testDay", "3")
|
15
15
|
end
|
16
16
|
|
17
|
-
client = Stat::Count::Client::ThriftStatCountClient.new({"servers" => "
|
18
|
-
Benchmark.bm do |bm|
|
17
|
+
client = Stat::Count::Client::ThriftStatCountClient.new({"servers" => "192.168.3.161:9095"});
|
18
|
+
Benchmark.bm(7) do |bm|
|
19
19
|
# joining an array of strings
|
20
|
-
bm.report do
|
20
|
+
bm.report("thrift-client") do
|
21
21
|
iterations.times do
|
22
22
|
reset(client)
|
23
23
|
count = CountMother.createIncrCount
|
@@ -28,10 +28,10 @@ Benchmark.bm do |bm|
|
|
28
28
|
end
|
29
29
|
|
30
30
|
|
31
|
-
client = Stat::Count::Client::StatCountClient.new("http://
|
32
|
-
Benchmark.bm do |bm|
|
31
|
+
client = Stat::Count::Client::StatCountClient.new("http://192.168.3.161:8100/stat-count-runtime/hessian/remoteSimpleCountCollecter");
|
32
|
+
Benchmark.bm(7) do |bm|
|
33
33
|
# joining an array of strings
|
34
|
-
bm.report do
|
34
|
+
bm.report("hessian-client") do
|
35
35
|
iterations.times do
|
36
36
|
reset(client)
|
37
37
|
count = CountMother.createIncrCount
|
@@ -14,7 +14,7 @@ class TC_StatCountClientTest < Test::Unit::TestCase
|
|
14
14
|
# Called before every test method runs. Can be used
|
15
15
|
# to set up fixture information.
|
16
16
|
def setup
|
17
|
-
@client = StatCountClient.new()
|
17
|
+
@client = StatCountClient.new('http://192.168.3.161:8100/stat-count-runtime/hessian/remoteSimpleCountCollecter')
|
18
18
|
end
|
19
19
|
|
20
20
|
# Called after every test method runs. Can be used to tear
|
@@ -14,7 +14,7 @@ class TC_StatCountClientTest < Test::Unit::TestCase
|
|
14
14
|
# Called before every test method runs. Can be used
|
15
15
|
# to set up fixture information.
|
16
16
|
def setup
|
17
|
-
@client = ThriftStatCountClient.new({"servers" => "
|
17
|
+
@client = ThriftStatCountClient.new({"servers" => "192.168.3.161:9095"});
|
18
18
|
end
|
19
19
|
|
20
20
|
# Called after every test method runs. Can be used to tear
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stat-count-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gavin
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2013-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: em_hessian2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
@@ -50,7 +50,7 @@ files:
|
|
50
50
|
- LICENSE
|
51
51
|
- Rakefile
|
52
52
|
- README.md
|
53
|
-
- test/
|
53
|
+
- test/count_benchmark.rb
|
54
54
|
- test/count_mother.rb
|
55
55
|
- test/stat_ccount_client_test.rb
|
56
56
|
- test/stat_count_client_test.rb
|
@@ -94,7 +94,7 @@ signing_key:
|
|
94
94
|
specification_version: 4
|
95
95
|
summary: stat count client
|
96
96
|
test_files:
|
97
|
-
- test/
|
97
|
+
- test/count_benchmark.rb
|
98
98
|
- test/count_mother.rb
|
99
99
|
- test/stat_ccount_client_test.rb
|
100
100
|
- test/stat_count_client_test.rb
|