OpenSDN source code
VmStat Class Reference

#include <vm_stat.h>

Inheritance diagram for VmStat:
Collaboration diagram for VmStat:

Public Types

typedef boost::function< void(void)> DoneCb
 

Public Member Functions

 VmStat (Agent *agent, const boost::uuids::uuid &vm_uuid)
 
virtual ~VmStat ()
 
bool marked_delete () const
 
virtual void Start ()
 
void Stop ()
 
void ProcessData ()
 

Static Public Attributes

static const size_t kBufLen = 4098
 
static const uint32_t kRetryCount = 3
 
static const uint16_t kInvalidCpuCount = 0xFFFF
 

Protected Member Functions

void StartTimer ()
 
void ExecCmd (std::string cmd, DoneCb cb)
 
void SendVmCpuStats ()
 
 DISALLOW_COPY_AND_ASSIGN (VmStat)
 

Protected Attributes

Agentagent_
 
const boost::uuids::uuid vm_uuid_
 
uint32_t mem_usage_
 
uint32_t virt_memory_
 
uint32_t virt_memory_peak_
 
uint32_t vm_memory_quota_
 
double prev_cpu_stat_
 
double cpu_usage_
 
time_t prev_cpu_snapshot_time_
 
std::vector< double > prev_vcpu_usage_
 
std::vector< double > vcpu_usage_percent_
 
time_t prev_vcpu_snapshot_time_
 
char rx_buff_ [kBufLen]
 
std::stringstream data_
 
boost::asio::posix::stream_descriptor input_
 
Timertimer_
 
bool marked_delete_
 
uint32_t pid_
 
uint32_t retry_
 
DoneCb call_back_
 
uint32_t virtual_size_
 
uint32_t disk_size_
 
std::string disk_name_
 
VrouterAgentVmState::type vm_state_
 
VrouterAgentVmState::type prev_vm_state_
 
uint16_t vm_cpu_count_
 
uint16_t prev_vm_cpu_count_
 

Private Member Functions

bool BuildVmStatsMsg (VirtualMachineStats *uve)
 
bool BuildVmMsg (UveVirtualMachineAgent *uve)
 
void ReadData (const boost::system::error_code &ec, size_t read_bytes, DoneCb &cb)
 
virtual bool TimerExpiry ()
 

Detailed Description

Definition at line 17 of file vm_stat.h.

Member Typedef Documentation

◆ DoneCb

typedef boost::function<void(void)> VmStat::DoneCb

Definition at line 22 of file vm_stat.h.

Constructor & Destructor Documentation

◆ VmStat()

VmStat::VmStat ( Agent agent,
const boost::uuids::uuid vm_uuid 
)

Definition at line 27 of file vm_stat.cc.

◆ ~VmStat()

VmStat::~VmStat ( )
virtual

Definition at line 41 of file vm_stat.cc.

Here is the call graph for this function:

Member Function Documentation

◆ BuildVmMsg()

bool VmStat::BuildVmMsg ( UveVirtualMachineAgent *  uve)
private

Definition at line 147 of file vm_stat.cc.

Here is the call graph for this function:

◆ BuildVmStatsMsg()

bool VmStat::BuildVmStatsMsg ( VirtualMachineStats *  uve)
private

Definition at line 127 of file vm_stat.cc.

Here is the call graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

VmStat::DISALLOW_COPY_AND_ASSIGN ( VmStat  )
protected

◆ ExecCmd()

void VmStat::ExecCmd ( std::string  cmd,
DoneCb  cb 
)
protected

Definition at line 74 of file vm_stat.cc.

Here is the call graph for this function:

◆ marked_delete()

bool VmStat::marked_delete ( ) const
inline

Definition at line 26 of file vm_stat.h.

◆ ProcessData()

void VmStat::ProcessData ( )

Definition at line 69 of file vm_stat.cc.

◆ ReadData()

void VmStat::ReadData ( const boost::system::error_code &  ec,
size_t  read_bytes,
DoneCb cb 
)
private

Definition at line 45 of file vm_stat.cc.

Here is the call graph for this function:

◆ SendVmCpuStats()

void VmStat::SendVmCpuStats ( )
protected

Definition at line 179 of file vm_stat.cc.

Here is the call graph for this function:

◆ Start()

void VmStat::Start ( )
virtual

Reimplemented in VmStatKvm, and VmStatDocker.

Definition at line 211 of file vm_stat.cc.

◆ StartTimer()

void VmStat::StartTimer ( )
protected

Definition at line 205 of file vm_stat.cc.

Here is the call graph for this function:

◆ Stop()

void VmStat::Stop ( )

Definition at line 214 of file vm_stat.cc.

Here is the call graph for this function:

◆ TimerExpiry()

bool VmStat::TimerExpiry ( )
privatevirtual

Reimplemented in VmStatKvm, and VmStatDocker.

Definition at line 201 of file vm_stat.cc.

Member Data Documentation

◆ agent_

Agent* VmStat::agent_
protected

Definition at line 43 of file vm_stat.h.

◆ call_back_

DoneCb VmStat::call_back_
protected

Definition at line 62 of file vm_stat.h.

◆ cpu_usage_

double VmStat::cpu_usage_
protected

Definition at line 50 of file vm_stat.h.

◆ data_

std::stringstream VmStat::data_
protected

Definition at line 56 of file vm_stat.h.

◆ disk_name_

std::string VmStat::disk_name_
protected

Definition at line 65 of file vm_stat.h.

◆ disk_size_

uint32_t VmStat::disk_size_
protected

Definition at line 64 of file vm_stat.h.

◆ input_

boost::asio::posix::stream_descriptor VmStat::input_
protected

Definition at line 57 of file vm_stat.h.

◆ kBufLen

const size_t VmStat::kBufLen = 4098
static

Definition at line 19 of file vm_stat.h.

◆ kInvalidCpuCount

const uint16_t VmStat::kInvalidCpuCount = 0xFFFF
static

Definition at line 21 of file vm_stat.h.

◆ kRetryCount

const uint32_t VmStat::kRetryCount = 3
static

Definition at line 20 of file vm_stat.h.

◆ marked_delete_

bool VmStat::marked_delete_
protected

Definition at line 59 of file vm_stat.h.

◆ mem_usage_

uint32_t VmStat::mem_usage_
protected

Definition at line 45 of file vm_stat.h.

◆ pid_

uint32_t VmStat::pid_
protected

Definition at line 60 of file vm_stat.h.

◆ prev_cpu_snapshot_time_

time_t VmStat::prev_cpu_snapshot_time_
protected

Definition at line 51 of file vm_stat.h.

◆ prev_cpu_stat_

double VmStat::prev_cpu_stat_
protected

Definition at line 49 of file vm_stat.h.

◆ prev_vcpu_snapshot_time_

time_t VmStat::prev_vcpu_snapshot_time_
protected

Definition at line 54 of file vm_stat.h.

◆ prev_vcpu_usage_

std::vector<double> VmStat::prev_vcpu_usage_
protected

Definition at line 52 of file vm_stat.h.

◆ prev_vm_cpu_count_

uint16_t VmStat::prev_vm_cpu_count_
protected

Definition at line 69 of file vm_stat.h.

◆ prev_vm_state_

VrouterAgentVmState::type VmStat::prev_vm_state_
protected

Definition at line 67 of file vm_stat.h.

◆ retry_

uint32_t VmStat::retry_
protected

Definition at line 61 of file vm_stat.h.

◆ rx_buff_

char VmStat::rx_buff_[kBufLen]
protected

Definition at line 55 of file vm_stat.h.

◆ timer_

Timer* VmStat::timer_
protected

Definition at line 58 of file vm_stat.h.

◆ vcpu_usage_percent_

std::vector<double> VmStat::vcpu_usage_percent_
protected

Definition at line 53 of file vm_stat.h.

◆ virt_memory_

uint32_t VmStat::virt_memory_
protected

Definition at line 46 of file vm_stat.h.

◆ virt_memory_peak_

uint32_t VmStat::virt_memory_peak_
protected

Definition at line 47 of file vm_stat.h.

◆ virtual_size_

uint32_t VmStat::virtual_size_
protected

Definition at line 63 of file vm_stat.h.

◆ vm_cpu_count_

uint16_t VmStat::vm_cpu_count_
protected

Definition at line 68 of file vm_stat.h.

◆ vm_memory_quota_

uint32_t VmStat::vm_memory_quota_
protected

Definition at line 48 of file vm_stat.h.

◆ vm_state_

VrouterAgentVmState::type VmStat::vm_state_
protected

Definition at line 66 of file vm_stat.h.

◆ vm_uuid_

const boost::uuids::uuid VmStat::vm_uuid_
protected

Definition at line 44 of file vm_stat.h.


The documentation for this class was generated from the following files: