class Object

Public Instance Methods

call(*args, &blk)
Also aliased as: call_without_profiling
Alias for: call_with_profiling
call_with_profiling(*args, &blk) click to toggle source
# File lib/nightwing/extensions/redis.rb, line 2
def call_with_profiling(*args, &blk)
  begin
    start_time = Time.now
    result = call_without_profiling(*args, &blk)
  ensure
    time_ellasped = (Time.now - start_time) * 1_000
    command = args.first.is_a?(Array) ? args[0][0] : args.first

    Nightwing.client.timing "redis.command.time", time_ellasped
    Nightwing.client.timing "redis.command.#{command}.time", time_ellasped

    Nightwing.client.increment "redis.command.processed"
    Nightwing.client.increment "redis.command.#{command}.processed"
  end

  result
end
Also aliased as: call
call_without_profiling(*args, &blk)
Alias for: call
perform(*args)
Also aliased as: perform_without_profiling
perform_with_profiling(*args) click to toggle source
# File lib/nightwing/extensions/dalli.rb, line 2
def perform_with_profiling(*args)
  begin
    start_time = Time.now
    result = perform_without_profiling(*args)
  ensure
    time_ellasped = (Time.now - start_time) * 1_000
    command = args.first.is_a?(Array) ? args[0][0] : args.first

    Nightwing.client.timing "memcache.command.time", time_ellasped
    Nightwing.client.timing "memcache.command.#{command}.time", time_ellasped

    Nightwing.client.increment "memcache.command.processed"
    Nightwing.client.increment "memcache.command.#{command}.processed"
  end

  result
end
Also aliased as: perform
perform_without_profiling(*args)
Alias for: perform