lib/fozzie/classes.rb in fozzie-0.0.7 vs lib/fozzie/classes.rb in fozzie-0.0.8
- old
+ new
@@ -29,9 +29,16 @@
def deploy; deployed; end
def deployed
event :deploy
end
+ def increment_on(stat, bool, sample_rate=1)
+ raise ArgumentError, "value must be True or False" unless [TrueClass, FalseClass].include?(bool.class)
+ key = "#{stat}.%s" % (bool ? "success" : "fail")
+ increment(key, sample_rate)
+ bool
+ end
+
private
def event(type)
timing "event.#{type.to_s}", Time.now.usec
end
\ No newline at end of file