9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/ring/sqa/graphite.rb', line 9
def add records
host = @hostname.split(".").first
node = @nodes.all
records.each do |record|
nodename = noderec = node[record.peer][:name].split(".").first
nodecc = noderec = node[record.peer][:cc].downcase
hash = {
"#{ROOT}.#{host}.#{nodecc}.#{nodename}.state" => record.result
}
if record.result != 'no response'
hash["#{ROOT}.#{host}.#{nodecc}.#{nodename}.latency"] = record.latency
end
@client.metrics hash, record.time
end
end
|