dalli 2.7.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of dalli might be problematic. Click here for more details.

data/lib/dalli/socket.rb CHANGED
@@ -1,108 +1,95 @@
1
- begin
2
- require 'kgio'
3
- puts "Using kgio socket IO" if defined?($TESTING) && $TESTING
1
+ # frozen_string_literal: true
4
2
 
5
- class Dalli::Server::KSocket < Kgio::Socket
6
- attr_accessor :options, :server
3
+ require 'openssl'
7
4
 
8
- def kgio_wait_readable
9
- IO.select([self], nil, nil, options[:socket_timeout]) || raise(Timeout::Error, "IO timeout")
10
- end
11
-
12
- def kgio_wait_writable
13
- IO.select(nil, [self], nil, options[:socket_timeout]) || raise(Timeout::Error, "IO timeout")
14
- end
5
+ module Dalli
6
+ module Socket
7
+ module InstanceMethods
15
8
 
16
- def self.open(host, port, server, options = {})
17
- addr = Socket.pack_sockaddr_in(port, host)
18
- sock = start(addr)
19
- sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
20
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) if options[:keepalive]
21
- sock.options = options
22
- sock.server = server
23
- sock.kgio_wait_writable
24
- sock
25
- end
9
+ def readfull(count)
10
+ value = +""
11
+ loop do
12
+ result = read_nonblock(count - value.bytesize, exception: false)
13
+ if result == :wait_readable
14
+ raise Timeout::Error, "IO timeout: #{safe_options.inspect}" unless IO.select([self], nil, nil, options[:socket_timeout])
15
+ elsif result == :wait_writable
16
+ raise Timeout::Error, "IO timeout: #{safe_options.inspect}" unless IO.select(nil, [self], nil, options[:socket_timeout])
17
+ elsif result
18
+ value << result
19
+ else
20
+ raise Errno::ECONNRESET, "Connection reset: #{safe_options.inspect}"
21
+ end
22
+ break if value.bytesize == count
23
+ end
24
+ value
25
+ end
26
26
 
27
- alias :write :kgio_write
27
+ def read_available
28
+ value = +""
29
+ loop do
30
+ result = read_nonblock(8196, exception: false)
31
+ if result == :wait_readable
32
+ break
33
+ elsif result == :wait_writable
34
+ break
35
+ elsif result
36
+ value << result
37
+ else
38
+ raise Errno::ECONNRESET, "Connection reset: #{safe_options.inspect}"
39
+ end
40
+ end
41
+ value
42
+ end
28
43
 
29
- def readfull(count)
30
- value = ''
31
- loop do
32
- value << kgio_read!(count - value.bytesize)
33
- break if value.bytesize == count
44
+ def safe_options
45
+ options.reject { |k, v| [:username, :password].include? k }
34
46
  end
35
- value
36
47
  end
37
48
 
38
- def read_available
39
- value = ''
40
- loop do
41
- ret = kgio_tryread(8196)
42
- case ret
43
- when nil
44
- raise EOFError, 'end of stream'
45
- when :wait_readable
46
- break
47
- else
48
- value << ret
49
- end
49
+ class SSLSocket < ::OpenSSL::SSL::SSLSocket
50
+ include Dalli::Socket::InstanceMethods
51
+ def options
52
+ io.options
50
53
  end
51
- value
52
54
  end
53
55
 
54
- end
55
-
56
- if ::Kgio.respond_to?(:wait_readable=)
57
- ::Kgio.wait_readable = :kgio_wait_readable
58
- ::Kgio.wait_writable = :kgio_wait_writable
59
- end
56
+ class TCP < TCPSocket
57
+ include Dalli::Socket::InstanceMethods
58
+ attr_accessor :options, :server
60
59
 
61
- rescue LoadError
60
+ def self.open(host, port, server, options = {})
61
+ Timeout.timeout(options[:socket_timeout]) do
62
+ sock = new(host, port)
63
+ sock.options = {host: host, port: port}.merge(options)
64
+ sock.server = server
65
+ sock.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true)
66
+ sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true) if options[:keepalive]
67
+ sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_RCVBUF, options[:rcvbuf]) if options[:rcvbuf]
68
+ sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_SNDBUF, options[:sndbuf]) if options[:sndbuf]
62
69
 
63
- puts "Using standard socket IO (#{RUBY_DESCRIPTION})" if defined?($TESTING) && $TESTING
64
- class Dalli::Server::KSocket < TCPSocket
65
- attr_accessor :options, :server
66
-
67
- def self.open(host, port, server, options = {})
68
- Timeout.timeout(options[:socket_timeout]) do
69
- sock = new(host, port)
70
- sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
71
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) if options[:keepalive]
72
- sock.options = { :host => host, :port => port }.merge(options)
73
- sock.server = server
74
- sock
75
- end
76
- end
70
+ return sock unless options[:ssl_context]
77
71
 
78
- def readfull(count)
79
- value = ''
80
- begin
81
- loop do
82
- value << read_nonblock(count - value.bytesize)
83
- break if value.bytesize == count
84
- end
85
- rescue Errno::EAGAIN, Errno::EWOULDBLOCK
86
- if IO.select([self], nil, nil, options[:socket_timeout])
87
- retry
88
- else
89
- raise Timeout::Error, "IO timeout: #{options.inspect}"
72
+ ssl_socket = Dalli::Socket::SSLSocket.new(sock, options[:ssl_context])
73
+ ssl_socket.hostname = host
74
+ ssl_socket.sync_close = true
75
+ ssl_socket.connect
76
+ ssl_socket
90
77
  end
91
78
  end
92
- value
93
79
  end
94
80
 
95
- def read_available
96
- value = ''
97
- loop do
98
- begin
99
- value << read_nonblock(8196)
100
- rescue Errno::EAGAIN, Errno::EWOULDBLOCK
101
- break
81
+ class UNIX < UNIXSocket
82
+ include Dalli::Socket::InstanceMethods
83
+ attr_accessor :options, :server
84
+
85
+ def self.open(path, server, options = {})
86
+ Timeout.timeout(options[:socket_timeout]) do
87
+ sock = new(path)
88
+ sock.options = {path: path}.merge(options)
89
+ sock.server = server
90
+ sock
102
91
  end
103
92
  end
104
- value
105
93
  end
106
-
107
94
  end
108
95
  end
data/lib/dalli/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dalli
2
- VERSION = '2.7.2'
4
+ VERSION = "3.0.0"
3
5
  end
data/lib/dalli.rb CHANGED
@@ -1,13 +1,17 @@
1
- require 'dalli/compressor'
2
- require 'dalli/client'
3
- require 'dalli/ring'
4
- require 'dalli/server'
5
- require 'dalli/socket'
6
- require 'dalli/version'
7
- require 'dalli/options'
8
- require 'dalli/railtie' if defined?(::Rails::Railtie)
1
+ # frozen_string_literal: true
2
+
3
+ require "dalli/compressor"
4
+ require "dalli/client"
5
+ require "dalli/ring"
6
+ require "dalli/protocol"
7
+ require "dalli/protocol/binary"
8
+ require "dalli/socket"
9
+ require "dalli/version"
10
+ require "dalli/options"
9
11
 
10
12
  module Dalli
13
+ autoload :Server, "dalli/server"
14
+
11
15
  # generic error
12
16
  class DalliError < RuntimeError; end
13
17
  # socket/server communication error
@@ -18,6 +22,8 @@ module Dalli
18
22
  class MarshalError < DalliError; end
19
23
  # application error in marshalling deserialization or decompression
20
24
  class UnmarshalError < DalliError; end
25
+ # payload too big for memcached
26
+ class ValueOverMaxSize < DalliError; end
21
27
 
22
28
  def self.logger
23
29
  @logger ||= (rails_logger || default_logger)
@@ -25,12 +31,12 @@ module Dalli
25
31
 
26
32
  def self.rails_logger
27
33
  (defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger) ||
28
- (defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:debug) && RAILS_DEFAULT_LOGGER)
34
+ (defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER.respond_to?(:debug) && RAILS_DEFAULT_LOGGER)
29
35
  end
30
36
 
31
37
  def self.default_logger
32
- require 'logger'
33
- l = Logger.new(STDOUT)
38
+ require "logger"
39
+ l = Logger.new($stdout)
34
40
  l.level = Logger::INFO
35
41
  l
36
42
  end
@@ -38,9 +44,4 @@ module Dalli
38
44
  def self.logger=(logger)
39
45
  @logger = logger
40
46
  end
41
-
42
- end
43
-
44
- if defined?(RAILS_VERSION) && RAILS_VERSION < '3'
45
- raise Dalli::DalliError, "Dalli #{Dalli::VERSION} does not support Rails version < 3.0"
46
47
  end
@@ -1,37 +1,92 @@
1
+ # frozen_string_literal: true
1
2
  require 'rack/session/abstract/id'
2
3
  require 'dalli'
4
+ require 'connection_pool'
3
5
 
4
6
  module Rack
5
7
  module Session
6
- class Dalli < Abstract::ID
7
- attr_reader :pool, :mutex
8
+ class Dalli < Abstract::Persisted
9
+ attr_reader :pool
8
10
 
9
- DEFAULT_OPTIONS = Abstract::ID::DEFAULT_OPTIONS.merge \
11
+ DEFAULT_DALLI_OPTIONS = {
10
12
  :namespace => 'rack:session',
11
13
  :memcache_server => 'localhost:11211'
14
+ }
12
15
 
16
+ # Brings in a new Rack::Session::Dalli middleware with the given
17
+ # `:memcache_server`. The server is either a hostname, or a
18
+ # host-with-port string in the form of "host_name:port", or an array of
19
+ # such strings. For example:
20
+ #
21
+ # use Rack::Session::Dalli,
22
+ # :memcache_server => "mc.example.com:1234"
23
+ #
24
+ # If no `:memcache_server` option is specified, Rack::Session::Dalli will
25
+ # connect to localhost, port 11211 (the default memcached port). If
26
+ # `:memcache_server` is set to nil, Dalli::Client will look for
27
+ # ENV['MEMCACHE_SERVERS'] and use that value if it is available, or fall
28
+ # back to the same default behavior described above.
29
+ #
30
+ # Rack::Session::Dalli is intended to be a drop-in replacement for
31
+ # Rack::Session::Memcache. It accepts additional options that control the
32
+ # behavior of Rack::Session, Dalli::Client, and an optional
33
+ # ConnectionPool. First and foremost, if you wish to instantiate your own
34
+ # Dalli::Client (or ConnectionPool) and use that instead of letting
35
+ # Rack::Session::Dalli instantiate it on your behalf, simply pass it in
36
+ # as the `:cache` option. Please note that you will be responsible for
37
+ # setting the namespace and any other options on Dalli::Client.
38
+ #
39
+ # Secondly, if you're not using the `:cache` option, Rack::Session::Dalli
40
+ # accepts the same options as Dalli::Client, so it's worth reviewing its
41
+ # documentation. Perhaps most importantly, if you don't specify a
42
+ # `:namespace` option, Rack::Session::Dalli will default to using
43
+ # "rack:session".
44
+ #
45
+ # Whether you are using the `:cache` option or not, it is not recommend
46
+ # to set `:expires_in`. Instead, use `:expire_after`, which will control
47
+ # both the expiration of the client cookie as well as the expiration of
48
+ # the corresponding entry in memcached.
49
+ #
50
+ # Rack::Session::Dalli also accepts a host of options that control how
51
+ # the sessions and session cookies are managed, including the
52
+ # aforementioned `:expire_after` option. Please see the documentation for
53
+ # Rack::Session::Abstract::Persisted for a detailed explanation of these
54
+ # options and their default values.
55
+ #
56
+ # Finally, if your web application is multithreaded, the
57
+ # Rack::Session::Dalli middleware can become a source of contention. You
58
+ # can use a connection pool of Dalli clients by passing in the
59
+ # `:pool_size` and/or `:pool_timeout` options. For example:
60
+ #
61
+ # use Rack::Session::Dalli,
62
+ # :memcache_server => "mc.example.com:1234",
63
+ # :pool_size => 10
64
+ #
65
+ # You must include the `connection_pool` gem in your project if you wish
66
+ # to use pool support. Please see the documentation for ConnectionPool
67
+ # for more information about it and its default options (which would only
68
+ # be applicable if you supplied one of the two options, but not both).
69
+ #
13
70
  def initialize(app, options={})
71
+ # Parent uses DEFAULT_OPTIONS to build @default_options for Rack::Session
14
72
  super
15
- @mutex = Mutex.new
16
- mserv = @default_options[:memcache_server]
17
- mopts = @default_options.reject{|k,v| !DEFAULT_OPTIONS.include? k }
18
- @pool = options[:cache] || ::Dalli::Client.new(mserv, mopts)
19
- @pool.alive!
20
- end
21
73
 
22
- def generate_sid
23
- loop do
24
- sid = super
25
- break sid unless @pool.get(sid)
26
- end
74
+ # Determine the default TTL for newly-created sessions
75
+ @default_ttl = ttl @default_options[:expire_after]
76
+
77
+ # Normalize and validate passed options
78
+ mserv, mopts, popts = extract_dalli_options(options)
79
+
80
+ @pool = ConnectionPool.new(popts || {}) { ::Dalli::Client.new(mserv, mopts) }
27
81
  end
28
82
 
29
83
  def get_session(env, sid)
30
- with_lock(env, [nil, {}]) do
31
- unless sid and !sid.empty? and session = @pool.get(sid)
32
- sid, session = generate_sid, {}
33
- unless @pool.add(sid, session)
34
- raise "Session collision on '#{sid.inspect}'"
84
+ with_block([nil, {}]) do |dc|
85
+ unless sid and !sid.empty? and session = dc.get(sid)
86
+ old_sid, sid, session = sid, generate_sid_with(dc), {}
87
+ unless dc.add(sid, session, @default_ttl)
88
+ sid = old_sid
89
+ redo # generate a new sid and try again
35
90
  end
36
91
  end
37
92
  [sid, session]
@@ -40,25 +95,61 @@ module Rack
40
95
 
41
96
  def set_session(env, session_id, new_session, options)
42
97
  return false unless session_id
43
- expiry = options[:expire_after]
44
- expiry = expiry.nil? ? 0 : expiry + 1
45
98
 
46
- with_lock(env, false) do
47
- @pool.set session_id, new_session, expiry
99
+ with_block(false) do |dc|
100
+ dc.set(session_id, new_session, ttl(options[:expire_after]))
48
101
  session_id
49
102
  end
50
103
  end
51
104
 
52
105
  def destroy_session(env, session_id, options)
53
- with_lock(env) do
54
- @pool.delete(session_id)
55
- generate_sid unless options[:drop]
106
+ with_block do |dc|
107
+ dc.delete(session_id)
108
+ generate_sid_with(dc) unless options[:drop]
56
109
  end
57
110
  end
58
111
 
59
- def with_lock(env, default=nil)
60
- @mutex.lock if env['rack.multithread']
61
- yield
112
+ def find_session(req, sid)
113
+ get_session req.env, sid
114
+ end
115
+
116
+ def write_session(req, sid, session, options)
117
+ set_session req.env, sid, session, options
118
+ end
119
+
120
+ def delete_session(req, sid, options)
121
+ destroy_session req.env, sid, options
122
+ end
123
+
124
+ private
125
+
126
+ def extract_dalli_options(options)
127
+ raise "Rack::Session::Dalli no longer supports the :cache option." if options[:cache]
128
+
129
+ popts = {}
130
+ # Filter out Rack::Session-specific options and apply our defaults
131
+ mopts = DEFAULT_DALLI_OPTIONS.merge \
132
+ options.reject {|k, _| DEFAULT_OPTIONS.key? k }
133
+ mserv = mopts.delete :memcache_server
134
+
135
+ if mopts[:pool_size] || mopts[:pool_timeout]
136
+ popts[:size] = mopts.delete :pool_size if mopts[:pool_size]
137
+ popts[:timeout] = mopts.delete :pool_timeout if mopts[:pool_timeout]
138
+ mopts[:threadsafe] = true
139
+ end
140
+
141
+ [mserv, mopts, popts]
142
+ end
143
+
144
+ def generate_sid_with(dc)
145
+ while true
146
+ sid = generate_sid
147
+ break sid unless dc.get(sid)
148
+ end
149
+ end
150
+
151
+ def with_block(default=nil, &block)
152
+ @pool.with(&block)
62
153
  rescue ::Dalli::DalliError, Errno::ECONNREFUSED
63
154
  raise if $!.message =~ /undefined class/
64
155
  if $VERBOSE
@@ -66,10 +157,11 @@ module Rack
66
157
  warn $!.inspect
67
158
  end
68
159
  default
69
- ensure
70
- @mutex.unlock if @mutex.locked?
71
160
  end
72
161
 
162
+ def ttl(expire_after)
163
+ expire_after.nil? ? 0 : expire_after + 1
164
+ end
73
165
  end
74
166
  end
75
167
  end
metadata CHANGED
@@ -1,31 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
+ - Peter M. Goldstein
7
8
  - Mike Perham
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-05-17 00:00:00.000000000 Z
12
+ date: 2021-10-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- name: minitest
15
+ name: rack
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: 4.2.0
20
+ version: '0'
20
21
  type: :development
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - ">="
25
26
  - !ruby/object:Gem::Version
26
- version: 4.2.0
27
+ version: '0'
27
28
  - !ruby/object:Gem::Dependency
28
- name: mocha
29
+ name: connection_pool
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - ">="
@@ -39,21 +40,23 @@ dependencies:
39
40
  - !ruby/object:Gem::Version
40
41
  version: '0'
41
42
  - !ruby/object:Gem::Dependency
42
- name: rails
43
+ name: openssl-extensions
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - "~>"
46
+ - - ">="
46
47
  - !ruby/object:Gem::Version
47
- version: '4'
48
+ version: '0'
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - "~>"
53
+ - - ">="
53
54
  - !ruby/object:Gem::Version
54
- version: '4'
55
+ version: '0'
55
56
  description: High performance memcached client for Ruby
56
- email: mperham@gmail.com
57
+ email:
58
+ - peter.m.goldstein@gmail.com
59
+ - mperham@gmail.com
57
60
  executables: []
58
61
  extensions: []
59
62
  extra_rdoc_files: []
@@ -61,46 +64,25 @@ files:
61
64
  - Gemfile
62
65
  - History.md
63
66
  - LICENSE
64
- - Performance.md
65
67
  - README.md
66
- - Rakefile
67
- - dalli.gemspec
68
- - lib/action_dispatch/middleware/session/dalli_store.rb
69
- - lib/active_support/cache/dalli_store.rb
70
68
  - lib/dalli.rb
71
69
  - lib/dalli/cas/client.rb
72
70
  - lib/dalli/client.rb
73
71
  - lib/dalli/compressor.rb
74
72
  - lib/dalli/options.rb
75
- - lib/dalli/railtie.rb
73
+ - lib/dalli/protocol.rb
74
+ - lib/dalli/protocol/binary.rb
76
75
  - lib/dalli/ring.rb
77
76
  - lib/dalli/server.rb
78
77
  - lib/dalli/socket.rb
79
78
  - lib/dalli/version.rb
80
79
  - lib/rack/session/dalli.rb
81
- - test/benchmark_test.rb
82
- - test/helper.rb
83
- - test/memcached_mock.rb
84
- - test/sasldb
85
- - test/test_active_support.rb
86
- - test/test_cas_client.rb
87
- - test/test_compressor.rb
88
- - test/test_dalli.rb
89
- - test/test_encoding.rb
90
- - test/test_failover.rb
91
- - test/test_network.rb
92
- - test/test_rack_session.rb
93
- - test/test_ring.rb
94
- - test/test_sasl.rb
95
- - test/test_serializer.rb
96
- - test/test_server.rb
97
- homepage: http://github.com/mperham/dalli
80
+ homepage: https://github.com/petergoldstein/dalli
98
81
  licenses:
99
82
  - MIT
100
83
  metadata: {}
101
- post_install_message:
102
- rdoc_options:
103
- - "--charset=UTF-8"
84
+ post_install_message:
85
+ rdoc_options: []
104
86
  require_paths:
105
87
  - lib
106
88
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -114,25 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
96
  - !ruby/object:Gem::Version
115
97
  version: '0'
116
98
  requirements: []
117
- rubyforge_project:
118
- rubygems_version: 2.2.2
119
- signing_key:
99
+ rubygems_version: 3.2.29
100
+ signing_key:
120
101
  specification_version: 4
121
102
  summary: High performance memcached client for Ruby
122
- test_files:
123
- - test/benchmark_test.rb
124
- - test/helper.rb
125
- - test/memcached_mock.rb
126
- - test/sasldb
127
- - test/test_active_support.rb
128
- - test/test_cas_client.rb
129
- - test/test_compressor.rb
130
- - test/test_dalli.rb
131
- - test/test_encoding.rb
132
- - test/test_failover.rb
133
- - test/test_network.rb
134
- - test/test_rack_session.rb
135
- - test/test_ring.rb
136
- - test/test_sasl.rb
137
- - test/test_serializer.rb
138
- - test/test_server.rb
103
+ test_files: []
data/Performance.md DELETED
@@ -1,42 +0,0 @@
1
- Performance
2
- ====================
3
-
4
- Caching is all about performance, so I carefully track Dalli performance to ensure no regressions.
5
- You can optionally use kgio to give Dalli a 10-20% performance boost: `gem install kgio`.
6
-
7
- Note I've added some benchmarks over time to Dalli that the other libraries don't necessarily have.
8
-
9
- memcache-client
10
- ---------------
11
-
12
- Testing 1.8.5 with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
13
-
14
- user system total real
15
- set:plain:memcache-client 1.860000 0.310000 2.170000 ( 2.188030)
16
- set:ruby:memcache-client 1.830000 0.290000 2.120000 ( 2.130212)
17
- get:plain:memcache-client 1.830000 0.340000 2.170000 ( 2.176156)
18
- get:ruby:memcache-client 1.900000 0.330000 2.230000 ( 2.235045)
19
- multiget:ruby:memcache-client 0.860000 0.120000 0.980000 ( 0.987348)
20
- missing:ruby:memcache-client 1.630000 0.320000 1.950000 ( 1.954867)
21
- mixed:ruby:memcache-client 3.690000 0.670000 4.360000 ( 4.364469)
22
-
23
-
24
- dalli
25
- -----
26
-
27
- Testing with Rails 3.2.1
28
- Using kgio socket IO
29
- Testing 2.0.0 with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
30
-
31
- user system total real
32
- mixed:rails:dalli 1.580000 0.570000 2.150000 ( 3.008839)
33
- set:plain:dalli 0.730000 0.300000 1.030000 ( 1.567098)
34
- setq:plain:dalli 0.520000 0.120000 0.640000 ( 0.634402)
35
- set:ruby:dalli 0.800000 0.300000 1.100000 ( 1.640348)
36
- get:plain:dalli 0.840000 0.330000 1.170000 ( 1.668425)
37
- get:ruby:dalli 0.850000 0.330000 1.180000 ( 1.665716)
38
- multiget:ruby:dalli 0.700000 0.260000 0.960000 ( 0.965423)
39
- missing:ruby:dalli 0.720000 0.320000 1.040000 ( 1.511720)
40
- mixed:ruby:dalli 1.660000 0.640000 2.300000 ( 3.320743)
41
- mixedq:ruby:dalli 1.630000 0.510000 2.140000 ( 2.629734)
42
- incr:ruby:dalli 0.270000 0.100000 0.370000 ( 0.547618)
data/Rakefile DELETED
@@ -1,42 +0,0 @@
1
- require 'appraisal'
2
- require 'rake/testtask'
3
- Rake::TestTask.new(:test) do |test|
4
- test.libs << 'test'
5
- test.pattern = 'test/**/test_*.rb'
6
- test.warning = true
7
- test.verbose = true
8
- end
9
-
10
- Rake::TestTask.new(:bench) do |test|
11
- test.libs << 'test'
12
- test.pattern = 'test/benchmark_test.rb'
13
- end
14
-
15
- begin
16
- require 'metric_fu'
17
- MetricFu::Configuration.run do |config|
18
- config.rcov[:rcov_opts] << "-Itest:lib"
19
- end
20
- rescue LoadError
21
- end
22
-
23
- task :default => :test
24
-
25
- task :test_all do
26
- system('rake test RAILS_VERSION="~> 3.0.0"')
27
- system('rake test RAILS_VERSION=">= 3.0.0"')
28
- end
29
-
30
- # 'gem install rdoc' to upgrade RDoc if this is giving you errors
31
- begin
32
- require 'rdoc/task'
33
- RDoc::Task.new do |rd|
34
- rd.rdoc_files.include("lib/**/*.rb")
35
- end
36
- rescue LoadError
37
- puts "Unable to load rdoc, run 'gem install rdoc' to fix this."
38
- end
39
-
40
- require 'rake/clean'
41
- CLEAN.include "**/*.rbc"
42
- CLEAN.include "**/.DS_Store"