Sha256: f4f4f4402a8e39be920aadcaeb4d4ff45f864f3c9340344309b9442cb64af01d

Contents?: true

Size: 567 Bytes

Versions: 1

Compression:

Stored size: 567 Bytes

Contents

module Couchbase::Operations
  module Stats

    def stats(statname = nil)
      sync_block_error if !async? && block_given?
      stats = if statname.nil?
                client.getStats
              else
                client.getStats(statname)
              end

      stats = stats.to_hash

      {}.tap do |hash|
        stats.each_pair do |node, values|
          node_value = node.to_s
          values.each_pair do |stat, value|
            hash[stat] ||= {}
            hash[stat][node_value] = value
          end
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couchbase-jruby-client-0.1.1 lib/couchbase/operations/stats.rb