diff options
author | Wild Kat <wk@users.noreply.github.com> | 2018-05-26 23:49:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-26 23:49:29 +0200 |
commit | 39dbb74c527c054007e26ad34c8921d4be6cb638 (patch) | |
tree | d55745153153450fb40e1f591eb861495a6068d9 /lib/oxidized/node | |
parent | defdc69f92b3bcf62b1fd3b5ceac63a7a4e637ae (diff) | |
parent | 42bf10b7bce34ff577c469f6c2f659f3913cbf4a (diff) |
Merge branch 'master' into FortiOS-Push
Diffstat (limited to 'lib/oxidized/node')
-rw-r--r-- | lib/oxidized/node/stats.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/oxidized/node/stats.rb b/lib/oxidized/node/stats.rb index 6b5719c..17b9a13 100644 --- a/lib/oxidized/node/stats.rb +++ b/lib/oxidized/node/stats.rb @@ -14,11 +14,16 @@ module Oxidized @stats[job.status] ||= [] @stats[job.status].shift if @stats[job.status].size > MAX_STAT @stats[job.status].push stat + if job.status.equal? :success + @stats[:success_count] += 1 + else + @stats[:failure_count] += 1 + end end # @param [Symbol] status stats for specific status # @return [Hash,Array] Hash of stats for every status or Array of stats for specific status - def get status=nil + def get status = nil status ? @stats[status] : @stats end @@ -26,8 +31,9 @@ module Oxidized def initialize @stats = {} + @stats[:success_count] = 0 + @stats[:failure_count] = 0 end - end end end |