Class: Redis::ScriptManager::Configuration
- Inherits:
-
Object
- Object
- Redis::ScriptManager::Configuration
- Defined in:
- lib/redis/script_manager.rb
Overview
Configuration interface for Redis::ScriptManager.
Instance Method Summary collapse
-
#do_minify_lua ⇒ Object
Defaults to false.
- #do_minify_lua=(do_minify_lua) ⇒ Object
-
#do_preload ⇒ Object
Defaults to false.
- #do_preload=(do_preload) ⇒ Object
-
#max_tiny_lua ⇒ Object
Scripts shorter than max_tiny_lua are always EVALed.
- #max_tiny_lua=(max_tiny_lua) ⇒ Object
-
#preload_cache_size ⇒ Object
The cache of shas which have been preloaded is not allowed to grow larger than this value.
- #preload_cache_size=(preload_cache_size) ⇒ Object
-
#stats_prefix ⇒ Object
Defaults to ”.
- #stats_prefix=(stats_prefix) ⇒ Object
-
#statsd ⇒ Object
Defaults to nil.
- #statsd=(statsd) ⇒ Object
Instance Method Details
#do_minify_lua ⇒ Object
Defaults to false.
If true, all Lua is minified conservatively to save bandwidth before any other logic or evaluation.
285 286 287 |
# File 'lib/redis/script_manager.rb', line 285 def do_minify_lua @do_minify_lua || false end |
#do_minify_lua=(do_minify_lua) ⇒ Object
288 289 290 |
# File 'lib/redis/script_manager.rb', line 288 def do_minify_lua=(do_minify_lua) @do_minify_lua = [true,'true'].include?(do_minify_lua) end |
#do_preload ⇒ Object
Defaults to false.
If true, shas are preloaded for each Redis connection (which make safe to use EVALSHA even in pipelines).
311 312 313 |
# File 'lib/redis/script_manager.rb', line 311 def do_preload @do_preload || false end |
#do_preload=(do_preload) ⇒ Object
314 315 316 |
# File 'lib/redis/script_manager.rb', line 314 def do_preload=(do_preload) @do_preload = [true,'true'].include?(do_preload) end |
#max_tiny_lua ⇒ Object
Scripts shorter than max_tiny_lua are always EVALed.
We skip all logic regarding EVALSHA, extra round-trips for SCRIPT LOAD, etc.
Defaults to 512. Integers and Strings which convert to Integers OK.
299 300 301 |
# File 'lib/redis/script_manager.rb', line 299 def max_tiny_lua @max_tiny_lua || 512 end |
#max_tiny_lua=(max_tiny_lua) ⇒ Object
302 303 304 |
# File 'lib/redis/script_manager.rb', line 302 def max_tiny_lua=(max_tiny_lua) @max_tiny_lua = max_tiny_lua.to_i end |
#preload_cache_size ⇒ Object
The cache of shas which have been preloaded is not allowed to grow larger than this value.
Defaults to 1000.
323 324 325 |
# File 'lib/redis/script_manager.rb', line 323 def preload_cache_size @preload_cache_size || 1000 end |
#preload_cache_size=(preload_cache_size) ⇒ Object
326 327 328 |
# File 'lib/redis/script_manager.rb', line 326 def preload_cache_size=(preload_cache_size) @preload_cache_size = preload_cache_size.to_i end |
#stats_prefix ⇒ Object
Defaults to ”.
Prefixed onto all metrics.
270 271 272 |
# File 'lib/redis/script_manager.rb', line 270 def stats_prefix @stats_prefix || '' end |
#stats_prefix=(stats_prefix) ⇒ Object
273 274 275 276 277 278 |
# File 'lib/redis/script_manager.rb', line 273 def stats_prefix=(stats_prefix) if stats_prefix && !stats_prefix.is_a?(String) raise ArgumentError, "bogus stats_prefix" end @stats_prefix = stats_prefix || '' end |
#statsd ⇒ Object
Defaults to nil. If non-nil, lots of stats will be tracked via statsd.increment and statsd.timing.
253 254 255 |
# File 'lib/redis/script_manager.rb', line 253 def statsd @statsd || nil end |
#statsd=(statsd) ⇒ Object
256 257 258 259 260 261 262 263 264 |
# File 'lib/redis/script_manager.rb', line 256 def statsd=(statsd) if statsd && !statsd.respond_to?(:increment) raise ArgumentError, "bogus statsd A #{statsd}" end if statsd && !statsd.respond_to?(:timing) raise ArgumentError, "bogus statsd B #{statsd}" end @statsd = statsd end |