Permalink
Browse files

tweaked loggs

  • Loading branch information...
1 parent 57b3b8a commit fe54f9c652a7af9036bdf3611d89e2676aab72c0 Eric Fode committed Dec 5, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/ferret.rb
View
@@ -57,16 +57,16 @@ def bash(opts={})
success &&= !!(out =~ opts[:pattern]) if opts[:pattern]
if success
- log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, status: status, measure: "#{ENV["TARGET"]}.#{opts[:name]}.success"
- log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, val: 100, measure: "#{ENV["TARGET"]}.#{opts[:name]}.uptime"
- log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, at: :return, val: Time.now - start, measure: "#{ENV["TARGET"]}.#{opts[:name]}.time"
+ log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, status: status, measure: "success"
+ log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, val: 100, measure: "uptime"
+ log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, at: :return, val: Time.now - start, measure: "time"
return success # break out of retry loop
else
out.each_line { |l| log source: ENV["TARGET"],fn: opts[:name], i: i, at: :failure, out: "'#{l.strip}'" }
# only measure last failure
if i == opts[:retry] - 1
- log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, status: status, measure: "#{ENV["TARGET"]}.#{opts[:name]}.failure"
- log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, val: 0, measure: "#{ENV["TARGET"]}.#{opts[:name]}.uptime"
+ log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, status: status, measure: "failure"
+ log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, val: 0, measure: "uptime"
else
log source: ENV["NAME"], app: ENV["APP"],fn: opts[:name], i: i, status: status
end

0 comments on commit fe54f9c

Please sign in to comment.