From f9c5f300e46e786de95abcb5bbaa7ae6cedd588a Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Tue, 12 Jun 2018 00:30:15 +0300 Subject: add mtime and bump up version Fixes performance regression --- lib/oxidized/node/stats.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/oxidized/node') 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 -- cgit v1.2.1