note description: "Statistics node" author: "Patrick Ruckstuhl " date: "$Date$" revision: "$Revision$" class NODE_STATISTICS inherit A_NODE_CLIENT redefine listen_queues, register_message_handlers end O_NODE O_STATISTICS_CONSTANTS create make feature -- Access name: STRING = "Origo statistics node" version: STRING = "$Revision$" feature {NONE} -- Implementation of message handlers statistics: DS_ARRAYED_LIST [STATISTIC] -- Registered statistics. listen_queues: DS_LIST [STRING] -- Listen queues. once Result := Precursor Result.put_last (origo_statistics_queue) end register_message_handlers -- Register message handlers. do Precursor create statistics.make (10) statistics.put_last (create {WORKITEM_STATISTIC}.make (Current)) statistics.put_last (create {ISSUE_STATISTIC}.make (Current)) statistics.put_last (create {WEB_STATISTIC}.make (Current)) register_main_loop_message_handler (statistics_namespace, statistics_create_type, agent create_statistics) register_main_loop_message_handler (statistics_namespace, statistics_update_type, agent update_statistics) end update_statistics (a_msg: A_MESSAGE) -- Update the statistics. require a_msg_ok: a_msg /= Void local l_cursor: DS_LIST_CURSOR [STATISTIC] do l_cursor := statistics.new_cursor from l_cursor.start until l_cursor.after loop l_cursor.item.update_statistic l_cursor.forth end end create_statistics (a_msg: A_MESSAGE) -- Create statistics files fro a project. require a_msg_ok: a_msg /= Void local l_msg: O_STATISTICS_CREATE_MESSAGE l_cursor: DS_LIST_CURSOR [STATISTIC] do l_msg ?= a_msg check valid_msg: l_msg /= Void end l_cursor := statistics.new_cursor from l_cursor.start until l_cursor.after loop l_cursor.item.create_statistic (l_msg.project_name.value) l_cursor.forth end end end