Sha256: f033153656d8adbafe4820cb9701c37452a968ed0fab1e151da578ced8b41093
Contents?: true
Size: 1020 Bytes
Versions: 37
Compression:
Stored size: 1020 Bytes
Contents
#-- # Copyright (c) 2016 SolarWinds, LLC. # All rights reserved. #++ # TODO remove Memcache from API and into some Util module to be included in Modules that need # ____ these methods module AppOpticsAPM module API ## # Utility methods for the Memcache instrumentation # currently used by dalli and memcached module Memcache #:nodoc: 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) return unless server_as_array.is_a?(Array) server = server_as_array.first if is_unix_socket?(server) 'localhost' elsif defined?(server.hostname) server.hostname end end end end end
Version data entries
37 entries across 37 versions & 3 rubygems