Class: Turn::Server::KV

Inherits:
Object
  • Object
show all
Defined in:
lib/turn/servers/kv.rb

Instance Method Summary collapse

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_infoObject


25
26
# File 'lib/turn/servers/kv.rb', line 25

def agent_info
end

#cpu_infoObject


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_usageObject


10
11
12
13
# File 'lib/turn/servers/kv.rb', line 10

def disk_usage
  # ssh
  # df -h | grep kv-data
end

#pair_countObject


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