OpenSDN source code
agent_uve_stats.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #include <base/cpuinfo.h>
7 #include <db/db.h>
8 #include <cmn/agent_cmn.h>
10 #include <oper/interface.h>
11 
12 #include <uve/stats_collector.h>
13 #include <uve/agent_uve_stats.h>
14 #include <uve/stats_interval_types.h>
15 #include <init/agent_param.h>
16 #include <oper/mirror_table.h>
18 #include <uve/vm_uve_table.h>
19 #include <uve/vn_uve_table.h>
20 #include <uve/vrouter_uve_entry.h>
22 
23 AgentUveStats::AgentUveStats(Agent *agent, uint64_t intvl,
24  uint32_t default_intvl, uint32_t incremental_intvl)
25  : AgentUveBase(agent, intvl, default_intvl, incremental_intvl),
26  stats_manager_(new StatsManager(agent)) {
27  vn_uve_table_.reset(new VnUveTable(agent, default_intvl));
28  vm_uve_table_.reset(new VmUveTable(agent, default_intvl));
31  default_intvl));
32 }
33 
35 }
36 
38  return stats_manager_.get();
39 }
40 
43  stats_manager_->Shutdown();
44 }
45 
48  stats_manager_->RegisterDBClients();
49 }
50 
53  stats_manager_->InitDone();
54 }
55 
56 // The following is deprecated and is present only for backward compatibility
57 void GetStatsInterval::HandleRequest() const {
58  StatsIntervalResp_InSeconds *resp = new StatsIntervalResp_InSeconds();
59  resp->set_agent_stats_interval(0);
60  resp->set_flow_stats_interval(0);
61  resp->set_context(context());
62  resp->Response();
63  return;
64 }
virtual void RegisterDBClients()
Agent * agent() const
boost::scoped_ptr< VnUveTableBase > vn_uve_table_
boost::scoped_ptr< VrouterUveEntryBase > vrouter_uve_entry_
boost::scoped_ptr< InterfaceUveTable > interface_uve_table_
boost::scoped_ptr< VmUveTableBase > vm_uve_table_
virtual void Shutdown()
virtual void InitDone()
AgentUveStats(Agent *agent, uint64_t intvl, uint32_t default_intvl, uint32_t incremental_intvl)
virtual void Shutdown()
virtual ~AgentUveStats()
StatsManager * stats_manager() const
boost::scoped_ptr< StatsManager > stats_manager_
virtual void RegisterDBClients()
Definition: agent.h:361