module Etcd::Stats

Support stats

Public Instance Methods

stats(type) click to toggle source
# File lib/etcd/stats.rb, line 11
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
    fail ArgumentError, "Invalid stats type '#{type}'"
  end
end
stats_endpoint() click to toggle source
# File lib/etcd/stats.rb, line 7
def stats_endpoint
  version_prefix + '/stats'
end