Sha256: 26c29166ddf93f39202916a7bc52e30749041ba377ee51195bdcaff01b89e5f1

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

# Encoding: utf-8

require 'json'

module Etcd
  module Stats

    def stats_endpoint
      version_prefix + '/stats'
    end

    def stats(type)
      case type
      when :leader
        JSON.parse(api_execute(stats_endpoint+'/leader', :get).body)
      when :store
        JSON.parse(api_execute(stats_endpoint+'/store', :get).body)
      when :self
        JSON.parse(api_execute(stats_endpoint+'/self', :get).body)
      else
        raise ArgumentError, "Invalid stats type '#{type}'"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
etcd-0.2.0.alpha lib/etcd/stats.rb