Sha256: 5b0b299a51f7867cf86a63e2c72db5e5ab52bfc1b6c119c6537e3fe2b26b3389
Contents?: true
Size: 848 Bytes
Versions: 43
Compression:
Stored size: 848 Bytes
Contents
# Copyright (c) 2013 AppNeta, Inc. # All rights reserved. module Oboe module API ## # Utility methods for the Memcache instrumentation module Memcache MEMCACHE_OPS = %w(add append cas decr decrement delete fetch get incr increment prepend replace set) def memcache_hit?(result) result.nil? ? 0 : 1 end def remote_host(key) return unless defined?(Lib.memcached_server_by_key) \ && defined?(@struct) && defined?(is_unix_socket?) server_as_array = Lib.memcached_server_by_key(@struct, key.to_s) if server_as_array.is_a?(Array) server = server_as_array.first if is_unix_socket?(server) return 'localhost' elsif defined?(server.hostname) return server.hostname end end end end end end
Version data entries
43 entries across 43 versions & 1 rubygems