class Riak::Client

Public Instance Methods

buckets(options = {}, &blk) click to toggle source
# File lib/patches/db/riak.rb, line 23
def buckets(options = {}, &blk)
  profile("buckets #{options}") { buckets_without_profiling(options, &blk) }
end
Also aliased as: buckets_without_profiling
buckets_without_profiling(options = {}, &blk)
Alias for: buckets
clear_bucket_props(bucket, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 83
def clear_bucket_props(bucket, options = {})
  profile("clear_bucket_props bucket=#{bucket.name} options=#{options}") { clear_bucket_props_without_profiling(bucket, options) }
end
clear_bucket_props_without_profiling(bucket, options = {})
Alias for: clear_bucket_props
client_id() click to toggle source
# File lib/patches/db/riak.rb, line 28
def client_id
  profile("client_id") { client_id_without_profiling }
end
Also aliased as: client_id_without_profiling
client_id_without_profiling()
Alias for: client_id
delete_object(bucket, key, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 33
def delete_object(bucket, key, options = {})
  profile("delete_object bucket=#{bucket.name} key=#{key} options=#{options}") { delete_object_without_profiling(bucket, key, options) }
end
delete_object_without_profiling(bucket, key, options = {})
Alias for: delete_object
get_bucket_props(bucket, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 38
def get_bucket_props(bucket, options = {})
  profile("get_bucket_props bucket=#{bucket.name} options=#{options}") { get_bucket_props_without_profiling(bucket, options) }
end
get_bucket_props_without_profiling(bucket, options = {})
Alias for: get_bucket_props
get_index(bucket, index, query, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 43
def get_index(bucket, index, query, options = {})
  profile("get_index bucket=#{bucket.name} index=#{index} query=#{query} options=#{options}") { get_index_without_profiling(bucket, index, query, options) }
end
Also aliased as: get_index_without_profiling
get_index_without_profiling(bucket, index, query, options = {})
Alias for: get_index
get_object(bucket, key, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 53
def get_object(bucket, key, options = {})
  profile("get_object bucket=#{bucket.name} key=#{key} options=#{options}") { get_object_without_profiling(bucket, key, options) }
end
Also aliased as: get_object_without_profiling
get_object_without_profiling(bucket, key, options = {})
Alias for: get_object
get_preflist(bucket, key, type = nil, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 48
def get_preflist(bucket, key, type = nil, options = {})
  profile("get_preflist bucket=#{bucket.name} key=#{key} type=#{type} options=#{options}") { get_preflist_without_profiling(bucket, key, type, options) }
end
get_preflist_without_profiling(bucket, key, type = nil, options = {})
Alias for: get_preflist
list_keys(bucket, options = {}, &block) click to toggle source
# File lib/patches/db/riak.rb, line 58
def list_keys(bucket, options = {}, &block)
  profile("list_keys bucket=#{bucket.name} options=#{options}") { list_keys_without_profiling(bucket, options, &block) }
end
Also aliased as: list_keys_without_profiling
list_keys_without_profiling(bucket, options = {}, &block)
Alias for: list_keys
mapred(mr, &block) click to toggle source
# File lib/patches/db/riak.rb, line 63
def mapred(mr, &block)
  profile("mapred") { mapred_without_profiling(mr, &block) }
end
Also aliased as: mapred_without_profiling
mapred_without_profiling(mr, &block)
Alias for: mapred
ping() click to toggle source
# File lib/patches/db/riak.rb, line 68
def ping
  profile("ping") { ping_without_profiling }
end
Also aliased as: ping_without_profiling
ping_without_profiling()
Alias for: ping
reload_object(object, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 73
def reload_object(object, options = {})
  profile("reload_object bucket=#{object.bucket.name} key=#{object.key} vclock=#{object.vclock} options=#{options}") { reload_object_without_profiling(object, options) }
end
reload_object_without_profiling(object, options = {})
Alias for: reload_object
set_bucket_props(bucket, properties, type = nil) click to toggle source
# File lib/patches/db/riak.rb, line 78
def set_bucket_props(bucket, properties, type = nil)
  profile("set_bucket_props bucket=#{bucket.name} type=#{type}") { set_bucket_props_without_profiling(bucket, properties, type) }
end
set_bucket_props_without_profiling(bucket, properties, type = nil)
Alias for: set_bucket_props
store_object(object, options = {}) click to toggle source
# File lib/patches/db/riak.rb, line 88
def store_object(object, options = {})
  profile("store_object bucket=#{object.bucket.name} key=#{object.key} vclock=#{object.vclock} options=#{options}") { store_object_without_profiling(object, options) }
end
store_object_without_profiling(object, options = {})
Alias for: store_object

Private Instance Methods

profile(request) { || ... } click to toggle source
# File lib/patches/db/riak.rb, line 94
def profile(request, &blk)
  return yield unless SqlPatches.should_measure?

  start        = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  result       = yield
  elapsed_time = SqlPatches.elapsed_time(start)
  record       = ::Rack::MiniProfiler.record_sql(request, elapsed_time)

  result
end