Class: Turn::Server::KV
- Inherits:
-
Object
- Object
- Turn::Server::KV
- Defined in:
- lib/turn/servers/kv.rb
Instance Method Summary collapse
- #agent_info ⇒ Object
- #cpu_info ⇒ Object
- #disk_usage ⇒ Object
-
#initialize(hostname, port) ⇒ KV
constructor
A new instance of KV.
- #pair_count ⇒ Object
Constructor Details
#initialize(hostname, port) ⇒ KV
Returns a new instance of KV.
5 6 7 8 |
# File 'lib/turn/servers/kv.rb', line 5 def initialize(hostname, port) @hostname = hostname @port = port end |
Instance Method Details
#agent_info ⇒ Object
25 26 |
# File 'lib/turn/servers/kv.rb', line 25 def agent_info end |
#cpu_info ⇒ Object
15 16 17 18 |
# File 'lib/turn/servers/kv.rb', line 15 def cpu_info # ssh # cat /proc/cpuinfo | grep \'model name\' | uniq | cut -d\':\' -f2 end |
#disk_usage ⇒ Object
10 11 12 13 |
# File 'lib/turn/servers/kv.rb', line 10 def disk_usage # ssh # df -h | grep kv-data end |
#pair_count ⇒ Object
20 21 22 23 |
# File 'lib/turn/servers/kv.rb', line 20 def pair_count metrics = Turn::Term.new(@hostname, @port).dump_public_metrics('KeyValueStorePopulation') metrics.values.reduce { |a, e| a + e } end |