0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
Hypertable::StatsSystem Class Reference

Collects, serializes and deserializes system-wide statistics. More...

#include <StatsSystem.h>

Inheritance diagram for Hypertable::StatsSystem:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::StatsSystem:
Collaboration graph
[legend]

Public Types

enum  Category {
  CPUINFO = 0x0001, CPU = 0x0002, LOADAVG = 0x0004, MEMORY = 0x0008,
  DISK = 0x0010, SWAP = 0x0020, NETINFO = 0x0040, NET = 0x0080,
  OSINFO = 0x0100, PROCINFO = 0x0200, PROC = 0x0400, FS = 0x0800,
  TERMINFO = 0x1000
}
 All statistics categories that are provided by this class. More...
 

Public Member Functions

 StatsSystem ()
 Default constructor; creates an empty object. More...
 
 StatsSystem (int32_t categories)
 Constructor; collects the specified categories. More...
 
 StatsSystem (int32_t categories, std::vector< String > &dirs)
 Constructor; collects the specified categories. More...
 
void add_categories (int32_t categories)
 Adds more categories to the already existing categories. More...
 
void add_categories (int32_t categories, std::vector< String > &dirs)
 Adds more categories and data directories. More...
 
void refresh ()
 Refreshes the statistics. More...
 
bool operator== (const StatsSystem &other) const
 Equal operator. More...
 
bool operator!= (const StatsSystem &other) const
 Not Equal operator. More...
 
- Public Member Functions inherited from Hypertable::StatsSerializable
 StatsSerializable (uint16_t _id, uint8_t _group_count)
 Constructor; creates a new object with an ID and a number of groups. More...
 
 StatsSerializable (const StatsSerializable &other)
 Copy constructor. More...
 
StatsSerializableoperator= (const StatsSerializable &other)
 Assignment operator. More...
 
size_t encoded_length () const
 Returns the encoded length of this object. More...
 
void encode (uint8_t **bufp) const
 Encodes the statistics to a serialized buffer. More...
 
void decode (const uint8_t **bufp, size_t *remainp)
 Deserializes this object from a buffer. More...
 
bool operator== (const StatsSerializable &other) const
 Equal operator. More...
 
bool operator!= (const StatsSerializable &other) const
 Not Equal operator. More...
 

Public Attributes

struct CpuInfo cpu_info
 CPU information (vendor, model, cores, cache sizes etc) More...
 
struct CpuStat cpu_stat
 CPU statistics (user load, system load, idle etc) More...
 
struct LoadAvgStat loadavg_stat
 Load average normalized over number of cores. More...
 
struct MemStat mem_stat
 Memory statistics (total size, free space, used etc) More...
 
struct SwapStat swap_stat
 Swapping statistics (page in, page out etc) More...
 
struct NetInfo net_info
 Network information (host name, primary interface, gateway etc) More...
 
struct NetStat net_stat
 Network statistics (transfer rates, receiving rate etc) More...
 
struct OsInfo os_info
 OS information (name, architecture, version etc) More...
 
struct ProcInfo proc_info
 Process information (pid, user, working directory etc) More...
 
struct ProcStat proc_stat
 Process statistics (CPU user time, system time, vm size etc) More...
 
struct TermInfo term_info
 Terminal information (number of lines, number of columns etc) More...
 
std::vector< struct DiskStatdisk_stat
 Per-Disk statistics (read-rate, write-rate, etc) More...
 
std::vector< struct FsStatfs_stat
 Filesystem statistics (free space, used space, aggregate files etc) More...
 

Protected Member Functions

virtual size_t encoded_length_group (int group) const
 Returns the encoded length of a statistics group. More...
 
virtual void encode_group (int group, uint8_t **bufp) const
 Serializes a statistics group to memory. More...
 
virtual void decode_group (int group, uint16_t len, const uint8_t **bufp, size_t *remainp)
 Deserializes a statistics group from memory. More...
 

Private Attributes

int32_t m_categories
 

Additional Inherited Members

- Protected Types inherited from Hypertable::StatsSerializable
enum  Identifier { SYSTEM = 1, RANGE = 2, TABLE = 3, RANGE_SERVER = 4 }
 Statistics identifer; assigned in constructor. More...
 
- Protected Attributes inherited from Hypertable::StatsSerializable
uint16_t id
 The statistics ID. More...
 
uint8_t group_count
 Number of groups in group_ids. More...
 
uint8_t group_ids [32]
 The actual group IDs. More...
 

Detailed Description

Collects, serializes and deserializes system-wide statistics.

Definition at line 43 of file StatsSystem.h.

Constructor & Destructor Documentation

Hypertable::StatsSystem::StatsSystem ( )
inline

Default constructor; creates an empty object.

Definition at line 63 of file StatsSystem.h.

StatsSystem::StatsSystem ( int32_t  categories)

Constructor; collects the specified categories.

Parameters
categoriesbit-wise ORed categories

Definition at line 55 of file StatsSystem.cc.

StatsSystem::StatsSystem ( int32_t  categories,
std::vector< String > &  dirs 
)

Constructor; collects the specified categories.

Parameters
categoriesbit-wise ORed categories
dirsVector of data directories which are monitored

Definition at line 62 of file StatsSystem.cc.

Member Function Documentation

void StatsSystem::add_categories ( int32_t  categories)

Adds more categories to the already existing categories.

Definition at line 69 of file StatsSystem.cc.

void StatsSystem::add_categories ( int32_t  categories,
std::vector< String > &  dirs 
)

Adds more categories and data directories.

Definition at line 117 of file StatsSystem.cc.

void StatsSystem::decode_group ( int  group,
uint16_t  len,
const uint8_t **  bufp,
size_t *  remainp 
)
protectedvirtual

Deserializes a statistics group from memory.

Implements Hypertable::StatsSerializable.

Definition at line 427 of file StatsSystem.cc.

void StatsSystem::encode_group ( int  group,
uint8_t **  bufp 
) const
protectedvirtual

Serializes a statistics group to memory.

Implements Hypertable::StatsSerializable.

Definition at line 300 of file StatsSystem.cc.

size_t StatsSystem::encoded_length_group ( int  group) const
protectedvirtual

Returns the encoded length of a statistics group.

Implements Hypertable::StatsSerializable.

Definition at line 225 of file StatsSystem.cc.

bool Hypertable::StatsSystem::operator!= ( const StatsSystem other) const
inline

Not Equal operator.

Definition at line 92 of file StatsSystem.h.

bool StatsSystem::operator== ( const StatsSystem other) const

Equal operator.

Definition at line 168 of file StatsSystem.cc.

void StatsSystem::refresh ( )

Refreshes the statistics.

Definition at line 141 of file StatsSystem.cc.

Member Data Documentation

struct CpuInfo Hypertable::StatsSystem::cpu_info

CPU information (vendor, model, cores, cache sizes etc)

Definition at line 97 of file StatsSystem.h.

struct CpuStat Hypertable::StatsSystem::cpu_stat

CPU statistics (user load, system load, idle etc)

Definition at line 100 of file StatsSystem.h.

std::vector<struct DiskStat> Hypertable::StatsSystem::disk_stat

Per-Disk statistics (read-rate, write-rate, etc)

Definition at line 130 of file StatsSystem.h.

std::vector<struct FsStat> Hypertable::StatsSystem::fs_stat

Filesystem statistics (free space, used space, aggregate files etc)

Definition at line 133 of file StatsSystem.h.

struct LoadAvgStat Hypertable::StatsSystem::loadavg_stat

Load average normalized over number of cores.

Definition at line 103 of file StatsSystem.h.

int32_t Hypertable::StatsSystem::m_categories
private

Definition at line 147 of file StatsSystem.h.

struct MemStat Hypertable::StatsSystem::mem_stat

Memory statistics (total size, free space, used etc)

Definition at line 106 of file StatsSystem.h.

struct NetInfo Hypertable::StatsSystem::net_info

Network information (host name, primary interface, gateway etc)

Definition at line 112 of file StatsSystem.h.

struct NetStat Hypertable::StatsSystem::net_stat

Network statistics (transfer rates, receiving rate etc)

Definition at line 115 of file StatsSystem.h.

struct OsInfo Hypertable::StatsSystem::os_info

OS information (name, architecture, version etc)

Definition at line 118 of file StatsSystem.h.

struct ProcInfo Hypertable::StatsSystem::proc_info

Process information (pid, user, working directory etc)

Definition at line 121 of file StatsSystem.h.

struct ProcStat Hypertable::StatsSystem::proc_stat

Process statistics (CPU user time, system time, vm size etc)

Definition at line 124 of file StatsSystem.h.

struct SwapStat Hypertable::StatsSystem::swap_stat

Swapping statistics (page in, page out etc)

Definition at line 109 of file StatsSystem.h.

struct TermInfo Hypertable::StatsSystem::term_info

Terminal information (number of lines, number of columns etc)

Definition at line 127 of file StatsSystem.h.


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