LCOV - code coverage report
Current view: top level - vnsw/agent/uve - agent_uve_stats.cc (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 25 32 78.1 %
Date: 2026-11-09 02:10:49 Functions: 6 8 75.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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>
       9             : #include <oper/interface_common.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>
      17             : #include <uve/vrouter_stats_collector.h>
      18             : #include <uve/vm_uve_table.h>
      19             : #include <uve/vn_uve_table.h>
      20             : #include <uve/vrouter_uve_entry.h>
      21             : #include <uve/interface_uve_stats_table.h>
      22             : 
      23           2 : AgentUveStats::AgentUveStats(Agent *agent, uint64_t intvl,
      24           2 :                              uint32_t default_intvl, uint32_t incremental_intvl)
      25             :     : AgentUveBase(agent, intvl, default_intvl, incremental_intvl),
      26           2 :       stats_manager_(new StatsManager(agent)) {
      27           2 :       vn_uve_table_.reset(new VnUveTable(agent, default_intvl));
      28           2 :       vm_uve_table_.reset(new VmUveTable(agent, default_intvl));
      29           2 :       vrouter_uve_entry_.reset(new VrouterUveEntry(agent));
      30           2 :       interface_uve_table_.reset(new InterfaceUveStatsTable(agent,
      31           2 :                                                             default_intvl));
      32           2 : }
      33             : 
      34           2 : AgentUveStats::~AgentUveStats() {
      35           2 : }
      36             : 
      37         384 : StatsManager *AgentUveStats::stats_manager() const {
      38         384 :     return stats_manager_.get();
      39             : }
      40             : 
      41           2 : void AgentUveStats::Shutdown() {
      42           2 :     AgentUveBase::Shutdown();
      43           2 :     stats_manager_->Shutdown();
      44           2 : }
      45             : 
      46           2 : void AgentUveStats::RegisterDBClients() {
      47           2 :     AgentUveBase::RegisterDBClients();
      48           2 :     stats_manager_->RegisterDBClients();
      49           2 : }
      50             : 
      51           2 : void AgentUveStats::InitDone() {
      52           2 :     AgentUveBase::InitDone();
      53           2 :     stats_manager_->InitDone();
      54           2 : }
      55             : 
      56             : // The following is deprecated and is present only for backward compatibility
      57           0 : void GetStatsInterval::HandleRequest() const {
      58           0 :     StatsIntervalResp_InSeconds *resp = new StatsIntervalResp_InSeconds();
      59           0 :     resp->set_agent_stats_interval(0);
      60           0 :     resp->set_flow_stats_interval(0);
      61           0 :     resp->set_context(context());
      62           0 :     resp->Response();
      63           0 :     return;
      64             : }

Generated by: LCOV version 1.14