OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

Definition at line 22 of file vm_stat.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file vm_stat.cc.

VmStat::~VmStat ( )
virtual

Definition at line 41 of file vm_stat.cc.

Here is the call graph for this function:

Member Function Documentation

bool VmStat::BuildVmMsg ( UveVirtualMachineAgent *  uve)
private

Definition at line 147 of file vm_stat.cc.

Here is the call graph for this function:

bool VmStat::BuildVmStatsMsg ( VirtualMachineStats *  uve)
private

Definition at line 127 of file vm_stat.cc.

Here is the call graph for this function:

VmStat::DISALLOW_COPY_AND_ASSIGN ( VmStat  )
protected
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:

bool VmStat::marked_delete ( ) const
inline

Definition at line 26 of file vm_stat.h.

void VmStat::ProcessData ( )

Definition at line 69 of file vm_stat.cc.

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:

void VmStat::SendVmCpuStats ( )
protected

Definition at line 179 of file vm_stat.cc.

Here is the call graph for this function:

void VmStat::Start ( )
virtual

Reimplemented in VmStatDocker, and VmStatKvm.

Definition at line 211 of file vm_stat.cc.

void VmStat::StartTimer ( )
protected

Definition at line 205 of file vm_stat.cc.

Here is the call graph for this function:

void VmStat::Stop ( )

Definition at line 214 of file vm_stat.cc.

Here is the call graph for this function:

bool VmStat::TimerExpiry ( )
privatevirtual

Reimplemented in VmStatKvm, and VmStatDocker.

Definition at line 201 of file vm_stat.cc.

Member Data Documentation

Agent* VmStat::agent_
protected

Definition at line 43 of file vm_stat.h.

DoneCb VmStat::call_back_
protected

Definition at line 62 of file vm_stat.h.

double VmStat::cpu_usage_
protected

Definition at line 50 of file vm_stat.h.

std::stringstream VmStat::data_
protected

Definition at line 56 of file vm_stat.h.

std::string VmStat::disk_name_
protected

Definition at line 65 of file vm_stat.h.

uint32_t VmStat::disk_size_
protected

Definition at line 64 of file vm_stat.h.

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

Definition at line 57 of file vm_stat.h.

const size_t VmStat::kBufLen = 4098
static

Definition at line 19 of file vm_stat.h.

const uint16_t VmStat::kInvalidCpuCount = 0xFFFF
static

Definition at line 21 of file vm_stat.h.

const uint32_t VmStat::kRetryCount = 3
static

Definition at line 20 of file vm_stat.h.

bool VmStat::marked_delete_
protected

Definition at line 59 of file vm_stat.h.

uint32_t VmStat::mem_usage_
protected

Definition at line 45 of file vm_stat.h.

uint32_t VmStat::pid_
protected

Definition at line 60 of file vm_stat.h.

time_t VmStat::prev_cpu_snapshot_time_
protected

Definition at line 51 of file vm_stat.h.

double VmStat::prev_cpu_stat_
protected

Definition at line 49 of file vm_stat.h.

time_t VmStat::prev_vcpu_snapshot_time_
protected

Definition at line 54 of file vm_stat.h.

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

Definition at line 52 of file vm_stat.h.

uint16_t VmStat::prev_vm_cpu_count_
protected

Definition at line 69 of file vm_stat.h.

VrouterAgentVmState::type VmStat::prev_vm_state_
protected

Definition at line 67 of file vm_stat.h.

uint32_t VmStat::retry_
protected

Definition at line 61 of file vm_stat.h.

char VmStat::rx_buff_[kBufLen]
protected

Definition at line 55 of file vm_stat.h.

Timer* VmStat::timer_
protected

Definition at line 58 of file vm_stat.h.

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

Definition at line 53 of file vm_stat.h.

uint32_t VmStat::virt_memory_
protected

Definition at line 46 of file vm_stat.h.

uint32_t VmStat::virt_memory_peak_
protected

Definition at line 47 of file vm_stat.h.

uint32_t VmStat::virtual_size_
protected

Definition at line 63 of file vm_stat.h.

uint16_t VmStat::vm_cpu_count_
protected

Definition at line 68 of file vm_stat.h.

uint32_t VmStat::vm_memory_quota_
protected

Definition at line 48 of file vm_stat.h.

VrouterAgentVmState::type VmStat::vm_state_
protected

Definition at line 66 of file vm_stat.h.

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: