lib/nutcracker.rb
# Returns hash with server and node statistics
# See example.json @ project root to get details about the structure
Returns hash with server and node statistics
See example.json @ project root to get details about the structure
Returns hash with server and node statistics See example . json @ project root to get details about the structure
def overview
      data = { :clusters => [], :config => config }
      stats.each do |cluster_name, cluster_data|
        unless cluster_data.is_a? Hash
          data[cluster_name] = cluster_data
          next
        end
        aliases = node_aliases cluster_name
        cluster = { nodes: [], name: cluster_name }
        cluster_data.each do |node, node_value|
          if node_value.kind_of? Hash
            node_data = cluster_data[node]
            node = aliases[node] || node
            url = ( node =~ /redis\:\/\// ) ? node : "redis://#{node}"
            info = redis_info(url, config[cluster_name]["redis_auth"])
            cluster[:nodes] << {
              server_url: url, info: info, running: info.any?
            }.merge(node_data)
          else 
            cluster[node] = node_value
          end
        end
        data[:clusters].push cluster
      end
      data
    end
def overview data = { :clusters => [ ] , :config => config } stats . each do | cluster_name , cluster_data | unless cluster_data . is_a? Hash data [ cluster_name ] = cluster_data next end aliases = node_aliases cluster_name cluster = { nodes : [ ] , name : cluster_name } cluster_data . each do | node , node_value | if node_value . kind_of? Hash node_data = cluster_data [ node ] node = aliases [ node ] || node url = ( node =~ / redis \: \/ \/ / ) ? node : "redis://#{node}" info = redis_info ( url , config [ cluster_name ] [ "redis_auth" ] ) cluster [ :nodes ] << { server_url : url , info : info , running : info . any? } . merge ( node_data ) else cluster [ node ] = node_value end end data [ :clusters ] . push cluster end data end
Returns hash with server and node statistics
See example.json @ project root to get details about the structure
Returns hash with server and node statistics See example . json @ project root to get details about the structure
# Setting global server attributes ( like hostname, version etc...) #next unless redis? cluster_name # skip memcached clusters # Adding node # Cluster attribute