    # File lib/active_support/vendor/memcache-client-1.6.5/memcache.rb, line 409
      def stats
        raise MemCacheError, "No active servers" unless active?
        server_stats = {}

        @servers.each do |server|
          next unless server.alive?

          with_socket_management(server) do |socket|
            value = nil
            socket.write "stats\r\n"
            stats = {}
            while line = socket.gets do
              raise_on_error_response! line
              break if line == "END\r\n"
              if line =~ /\ASTAT ([\S]+) ([\w\.\:]+)/ then
                name, value = $1, $2
                stats[name] = case name
                              when 'version'
                                value
                              when 'rusage_user', 'rusage_system' then
                                seconds, microseconds = value.split(/:/, 2)
                                microseconds ||= 0
                                Float(seconds) + (Float(microseconds) / 1_000_000)
                              else
                                if value =~ /\A\d+\Z/ then
                                  value.to_i
                                else
                                  value
                                end
                              end
              end
            end
            server_stats["#{server.host}:#{server.port}"] = stats
          end
        end

        raise MemCacheError, "No active servers" if server_stats.empty?
        server_stats
      end