summaryrefslogtreecommitdiff
path: root/lib/oxidized/node
diff options
context:
space:
mode:
authorSaku Ytti <saku@ytti.fi>2018-06-12 00:30:15 +0300
committerSaku Ytti <saku@ytti.fi>2018-06-12 00:30:15 +0300
commitf9c5f300e46e786de95abcb5bbaa7ae6cedd588a (patch)
tree78cb0ea81a5afb19c2b3c29d32821c8c80612942 /lib/oxidized/node
parent5df10b5a6880747a9f659905dd7b4b75f338c8bb (diff)
add mtime and bump up version
Fixes performance regression
Diffstat (limited to 'lib/oxidized/node')
-rw-r--r--lib/oxidized/node/stats.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/oxidized/node/stats.rb b/lib/oxidized/node/stats.rb
index 0778d6d..fbc2cf7 100644
--- a/lib/oxidized/node/stats.rb
+++ b/lib/oxidized/node/stats.rb
@@ -1,6 +1,7 @@
module Oxidized
class Node
class Stats
+ attr_accessor :mtime
MAX_STAT = 10
# @param [Job] job job whose information add to stats
@@ -35,9 +36,14 @@ module Oxidized
@stats[:counter].reduce(0) { |m, h| h[0] == :success ? m : m + h[1] }
end
+ def update_mtime
+ @mtime = Time.now.utc
+ end
+
private
def initialize
+ @mtime = "unknown"
@stats = {}
@stats[:counter] = Hash.new 0
end