memcached 1.0.2 → 1.0.5
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.
- data.tar.gz.sig +0 -0
- data/BENCHMARKS +2 -1
- data/CHANGELOG +5 -0
- data/Manifest +2 -0
- data/ext/extconf.rb +4 -0
- data/ext/libmemcached-6.patch +20 -0
- data/ext/rlibmemcached.i +1 -0
- data/ext/rlibmemcached_wrap.c +8 -16
- data/memcached.gemspec +3 -3
- data/test/profile/benchmark.rb +6 -3
- data/test/unit/memcached_test.rb +24 -0
- metadata +8 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/BENCHMARKS
CHANGED
@@ -7,7 +7,7 @@ You can easily run your own benchmarks, as long as you have memcached itself on
|
|
7
7
|
|
8
8
|
== x86-64 OS X
|
9
9
|
|
10
|
-
These benchmarks were run on
|
10
|
+
These benchmarks were run on a 64-bit multicore Linux machine, with memcached 1.4.4:
|
11
11
|
|
12
12
|
Darwin amber.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT
|
13
13
|
2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
|
@@ -125,3 +125,4 @@ These benchmarks were run on an OS X 10.5 Core 2 Duo machine:
|
|
125
125
|
hash:murmur 0.210000 0.000000 0.210000 ( 0.203083)
|
126
126
|
hash:jenkins 0.240000 0.000000 0.240000 ( 0.245728)
|
127
127
|
hash:none 0.120000 0.000000 0.120000 ( 0.121219)
|
128
|
+
|
data/CHANGELOG
CHANGED
data/Manifest
CHANGED
@@ -11,6 +11,7 @@ ext/libmemcached-2.patch
|
|
11
11
|
ext/libmemcached-3.patch
|
12
12
|
ext/libmemcached-4.patch
|
13
13
|
ext/libmemcached-5.patch
|
14
|
+
ext/libmemcached-6.patch
|
14
15
|
ext/libmemcached.patch
|
15
16
|
ext/rlibmemcached.i
|
16
17
|
ext/rlibmemcached_wrap.c
|
@@ -23,6 +24,7 @@ lib/memcached/experimental.rb
|
|
23
24
|
lib/memcached/integer.rb
|
24
25
|
lib/memcached/memcached.rb
|
25
26
|
lib/memcached/rails.rb
|
27
|
+
memcached.gemspec
|
26
28
|
test/profile/benchmark.rb
|
27
29
|
test/profile/profile.rb
|
28
30
|
test/profile/valgrind.rb
|
data/ext/extconf.rb
CHANGED
@@ -71,6 +71,10 @@ def check_libmemcached
|
|
71
71
|
puts(cmd = "#{patch} -p1 -Z < libmemcached-5.patch")
|
72
72
|
raise "'#{cmd}' failed" unless system(cmd) or ENV['DEV']
|
73
73
|
|
74
|
+
puts "Patching libmemcached for failure count breakage."
|
75
|
+
puts(cmd = "#{patch} -p1 -Z < libmemcached-6.patch")
|
76
|
+
raise "'#{cmd}' failed" unless system(cmd) or ENV['DEV']
|
77
|
+
|
74
78
|
puts "Touching aclocal.m4 in libmemcached."
|
75
79
|
puts(cmd = "touch -r #{BUNDLE_PATH}/m4/visibility.m4 #{BUNDLE_PATH}/configure.ac #{BUNDLE_PATH}/m4/pandora_have_sasl.m4")
|
76
80
|
raise "'#{cmd}' failed" unless system(cmd)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
diff --git a/libmemcached-0.32/libmemcached/memcached_quit.c b/libmemcached-0.32/libmemcached/memcached_quit.c
|
2
|
+
index 9a200a1..80a03bc 100644
|
3
|
+
--- a/libmemcached-0.32/libmemcached/memcached_quit.c
|
4
|
+
+++ b/libmemcached-0.32/libmemcached/memcached_quit.c
|
5
|
+
@@ -49,7 +49,14 @@ void memcached_quit_server(memcached_server_st *ptr, uint8_t io_death)
|
6
|
+
memcached_server_response_reset(ptr);
|
7
|
+
}
|
8
|
+
|
9
|
+
- ptr->server_failure_counter++;
|
10
|
+
+ if (io_death)
|
11
|
+
+ {
|
12
|
+
+ ptr->server_failure_counter++;
|
13
|
+
+ }
|
14
|
+
+ else
|
15
|
+
+ {
|
16
|
+
+ ptr->server_failure_counter = 0;
|
17
|
+
+ }
|
18
|
+
}
|
19
|
+
|
20
|
+
void memcached_quit(memcached_st *ptr)
|
data/ext/rlibmemcached.i
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
|
24
24
|
%apply unsigned short { uint8_t };
|
25
25
|
%apply unsigned int { uint16_t };
|
26
|
+
%apply unsigned int { uint32_t server_failure_counter };
|
26
27
|
%apply unsigned int { uint32_t user_spec_len };
|
27
28
|
%apply unsigned long { uint32_t flags, uint32_t offset, uint32_t weight };
|
28
29
|
%apply unsigned long long { uint64_t data, uint64_t cas };
|
data/ext/rlibmemcached_wrap.c
CHANGED
@@ -10924,8 +10924,8 @@ _wrap_MemcachedServerSt_server_failure_counter_set(int argc, VALUE *argv, VALUE
|
|
10924
10924
|
uint32_t arg2 ;
|
10925
10925
|
void *argp1 = 0 ;
|
10926
10926
|
int res1 = 0 ;
|
10927
|
-
|
10928
|
-
int
|
10927
|
+
unsigned int val2 ;
|
10928
|
+
int ecode2 = 0 ;
|
10929
10929
|
|
10930
10930
|
if ((argc < 1) || (argc > 1)) {
|
10931
10931
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
@@ -10935,17 +10935,11 @@ _wrap_MemcachedServerSt_server_failure_counter_set(int argc, VALUE *argv, VALUE
|
|
10935
10935
|
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "struct memcached_server_st *","server_failure_counter", 1, self ));
|
10936
10936
|
}
|
10937
10937
|
arg1 = (struct memcached_server_st *)(argp1);
|
10938
|
-
|
10939
|
-
|
10940
|
-
|
10941
|
-
|
10942
|
-
|
10943
|
-
if (!argp2) {
|
10944
|
-
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "uint32_t","server_failure_counter", 2, argv[0]));
|
10945
|
-
} else {
|
10946
|
-
arg2 = *((uint32_t *)(argp2));
|
10947
|
-
}
|
10948
|
-
}
|
10938
|
+
ecode2 = SWIG_AsVal_unsigned_SS_int(argv[0], &val2);
|
10939
|
+
if (!SWIG_IsOK(ecode2)) {
|
10940
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint32_t","server_failure_counter", 2, argv[0] ));
|
10941
|
+
}
|
10942
|
+
arg2 = (uint32_t)(val2);
|
10949
10943
|
if (arg1) (arg1)->server_failure_counter = arg2;
|
10950
10944
|
return Qnil;
|
10951
10945
|
fail:
|
@@ -10970,9 +10964,7 @@ _wrap_MemcachedServerSt_server_failure_counter_get(int argc, VALUE *argv, VALUE
|
|
10970
10964
|
}
|
10971
10965
|
arg1 = (struct memcached_server_st *)(argp1);
|
10972
10966
|
result = ((arg1)->server_failure_counter);
|
10973
|
-
|
10974
|
-
vresult = UINT2NUM(result);
|
10975
|
-
}
|
10967
|
+
vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
|
10976
10968
|
return vresult;
|
10977
10969
|
fail:
|
10978
10970
|
return Qnil;
|
data/memcached.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{memcached}
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Weaver"]
|
9
9
|
s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
|
10
|
-
s.date = %q{
|
10
|
+
s.date = %q{2011-01-27}
|
11
11
|
s.description = %q{An interface to the libmemcached C client.}
|
12
12
|
s.email = %q{}
|
13
13
|
s.extensions = ["ext/extconf.rb"]
|
14
14
|
s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README", "TODO", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
|
15
|
-
s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf.rb", "ext/libmemcached-0.32.tar.gz", "ext/libmemcached-2.patch", "ext/libmemcached-3.patch", "ext/libmemcached-4.patch", "ext/libmemcached-5.patch", "ext/libmemcached.patch", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "ext/sasl.patch", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/integer.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/profile.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"
|
15
|
+
s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf.rb", "ext/libmemcached-0.32.tar.gz", "ext/libmemcached-2.patch", "ext/libmemcached-3.patch", "ext/libmemcached-4.patch", "ext/libmemcached-5.patch", "ext/libmemcached-6.patch", "ext/libmemcached.patch", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "ext/sasl.patch", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/experimental.rb", "lib/memcached/integer.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "memcached.gemspec", "test/profile/benchmark.rb", "test/profile/profile.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_experimental_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
|
16
16
|
s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/memcached/}
|
17
17
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Memcached", "--main", "README"]
|
18
18
|
s.require_paths = ["lib", "ext"]
|
data/test/profile/benchmark.rb
CHANGED
@@ -10,12 +10,15 @@ require 'ruby-debug' if ENV['DEBUG']
|
|
10
10
|
begin; require 'memory'; rescue LoadError; end
|
11
11
|
|
12
12
|
puts `uname -a`
|
13
|
+
puts `ruby -v`
|
14
|
+
puts `env | egrep '^RUBY'`
|
13
15
|
puts "Ruby #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
|
14
16
|
|
15
17
|
[ ["memcached", "memcached"],
|
16
18
|
["remix-stash", "remix/stash"],
|
17
19
|
# ["astro-remcached", "remcached"], # Clobbers the "Memcached" constant
|
18
20
|
["memcache-client", "memcache"],
|
21
|
+
["kgio", "kgio"],
|
19
22
|
["dalli","dalli"]].each do |gem_name, requirement|
|
20
23
|
require requirement
|
21
24
|
gem gem_name
|
@@ -121,9 +124,9 @@ class Bench
|
|
121
124
|
begin
|
122
125
|
yield client
|
123
126
|
@benchmark.report("#{test_name}: #{client_name}") { @loops.times { yield client } }
|
124
|
-
rescue => e
|
125
|
-
|
126
|
-
|
127
|
+
rescue Exception => e
|
128
|
+
puts "#{test_name}:#{client_name} => #{e.inspect}"
|
129
|
+
reset_clients
|
127
130
|
end
|
128
131
|
end
|
129
132
|
puts
|
data/test/unit/memcached_test.rb
CHANGED
@@ -1046,6 +1046,30 @@ class MemcachedTest < Test::Unit::TestCase
|
|
1046
1046
|
socket.close
|
1047
1047
|
end
|
1048
1048
|
|
1049
|
+
def test_wrong_failure_counter
|
1050
|
+
cache = Memcached.new(
|
1051
|
+
[@servers.last],
|
1052
|
+
:prefix_key => @prefix_key,
|
1053
|
+
:auto_eject_hosts => true,
|
1054
|
+
:server_failure_limit => 1,
|
1055
|
+
:retry_timeout => 1,
|
1056
|
+
:hash_with_prefix_key => false,
|
1057
|
+
:hash => :md5,
|
1058
|
+
:exception_retry_limit => 0
|
1059
|
+
)
|
1060
|
+
|
1061
|
+
# This is an abuse of knowledge, but it's necessary to verify that
|
1062
|
+
# the library is handling the counter properly.
|
1063
|
+
struct = cache.instance_variable_get(:@struct)
|
1064
|
+
server = Memcached::Lib.memcached_server_by_key(struct, "marmotte").first
|
1065
|
+
|
1066
|
+
# set to ensure connectivity
|
1067
|
+
cache.set("marmotte", "milk")
|
1068
|
+
server.server_failure_counter = 0
|
1069
|
+
cache.quit
|
1070
|
+
assert_equal 0, server.server_failure_counter
|
1071
|
+
end
|
1072
|
+
|
1049
1073
|
def test_missing_server
|
1050
1074
|
cache = Memcached.new(
|
1051
1075
|
[@servers.last, 'localhost:43041'],
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memcached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
9
|
+
- 5
|
10
|
+
version: 1.0.5
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Evan Weaver
|
@@ -35,7 +36,7 @@ cert_chain:
|
|
35
36
|
yZ0=
|
36
37
|
-----END CERTIFICATE-----
|
37
38
|
|
38
|
-
date:
|
39
|
+
date: 2011-01-27 00:00:00 -08:00
|
39
40
|
default_executable:
|
40
41
|
dependencies: []
|
41
42
|
|
@@ -71,6 +72,7 @@ files:
|
|
71
72
|
- ext/libmemcached-3.patch
|
72
73
|
- ext/libmemcached-4.patch
|
73
74
|
- ext/libmemcached-5.patch
|
75
|
+
- ext/libmemcached-6.patch
|
74
76
|
- ext/libmemcached.patch
|
75
77
|
- ext/rlibmemcached.i
|
76
78
|
- ext/rlibmemcached_wrap.c
|
@@ -83,6 +85,7 @@ files:
|
|
83
85
|
- lib/memcached/integer.rb
|
84
86
|
- lib/memcached/memcached.rb
|
85
87
|
- lib/memcached/rails.rb
|
88
|
+
- memcached.gemspec
|
86
89
|
- test/profile/benchmark.rb
|
87
90
|
- test/profile/profile.rb
|
88
91
|
- test/profile/valgrind.rb
|
@@ -93,7 +96,6 @@ files:
|
|
93
96
|
- test/unit/memcached_experimental_test.rb
|
94
97
|
- test/unit/memcached_test.rb
|
95
98
|
- test/unit/rails_test.rb
|
96
|
-
- memcached.gemspec
|
97
99
|
has_rdoc: true
|
98
100
|
homepage: http://blog.evanweaver.com/files/doc/fauna/memcached/
|
99
101
|
licenses: []
|
@@ -114,6 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
116
|
requirements:
|
115
117
|
- - ">="
|
116
118
|
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
117
120
|
segments:
|
118
121
|
- 0
|
119
122
|
version: "0"
|
@@ -122,6 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
125
|
requirements:
|
123
126
|
- - ">="
|
124
127
|
- !ruby/object:Gem::Version
|
128
|
+
hash: 11
|
125
129
|
segments:
|
126
130
|
- 1
|
127
131
|
- 2
|
metadata.gz.sig
CHANGED
Binary file
|