diff options
author | rhenium <rhenium@rhe.jp> | 2014-05-17 11:41:08 +0900 |
---|---|---|
committer | rhenium <rhenium@rhe.jp> | 2014-05-17 11:41:08 +0900 |
commit | 685c05640bed0f8f38bb5303f4c79b9c04937894 (patch) | |
tree | 45a42387526683d790cb6789fd8190e53b40eed1 /lib | |
parent | f0c6f44bfa8cc30500139357456b57f613b97b94 (diff) | |
download | aclog-685c05640bed0f8f38bb5303f4c79b9c04937894.tar.gz |
app/collector: about#status: show node activated_time instead of start_time. start_time isn't important.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/collector/control_server.rb | 2 | ||||
-rw-r--r-- | lib/collector/node_connection.rb | 5 | ||||
-rw-r--r-- | lib/collector/node_manager.rb | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/collector/control_server.rb b/lib/collector/control_server.rb index 5a22d08..5afb2b2 100644 --- a/lib/collector/control_server.rb +++ b/lib/collector/control_server.rb @@ -12,7 +12,7 @@ module Collector active_node_statuses = Settings.collector.nodes_count.times.map do |number| node = NodeManager.active_connections[number] if node - { start_time: node.start_time } + { activated_time: node.activated_time } else nil end diff --git a/lib/collector/node_connection.rb b/lib/collector/node_connection.rb index 9b9134b..6afed41 100644 --- a/lib/collector/node_connection.rb +++ b/lib/collector/node_connection.rb @@ -1,6 +1,7 @@ module Collector class NodeConnection < EM::Connection - attr_reader :connection_id, :start_time + attr_reader :connection_id + attr_accessor :activated_time @@_id = 0 @@ -9,7 +10,7 @@ module Collector @connection_id = (@@_id += 1) @authenticated = false @closing = false - @start_time = Time.now + @activated_time = nil end def unbind diff --git a/lib/collector/node_manager.rb b/lib/collector/node_manager.rb index f47c7cf..e008dfa 100644 --- a/lib/collector/node_manager.rb +++ b/lib/collector/node_manager.rb @@ -45,6 +45,7 @@ module Collector con = self.inactive_connections.shift if con self.active_connections[first_inactive_id] = con + con.activated_time = Time.now Rails.logger.warn("[NodeManager] Registered node ##{con.connection_id} as group ##{first_inactive_id}") Account.for_node(first_inactive_id).each do |a| con.register_account(a) |