Module: Etcd::Stats
- Included in:
- Client
- Defined in:
- lib/etcd/stats.rb
Overview
Support stats
Instance Method Summary collapse
Instance Method Details
#stats(type) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/etcd/stats.rb', line 12 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 ⇒ Object
8 9 10 |
# File 'lib/etcd/stats.rb', line 8 def stats_endpoint version_prefix + '/stats' end |