性能监视器
读数存储
性能监视器数据库将标量读数存储在名为 PerfReading 的类中,其定义如下:
transient class PerfReading
{
uint2 node; /* 集群节点 ID,或 0 */
uint2 db;
uint8 stamp;
vector <uint4> values;
tree <node,db,stamp> rec_idx;
tree <stamp> stamp_idx;
};
聚合值存储
聚合值存储在如下定义的 PerfTimingReading 类中:
transient class PerfTimingReading
{
uint2 node;
uint2 db;
uint8 stamp;
vector <uint8> current;
vector <uint8> min;
vector <uint8> max;
vector <uint8> avg;
vector <uint8> total;
vector <uint4> count;
tree <node, db, stamp> rec_idx;
tree <stamp> stamp_idx;
};
性能计数器
该数据库还维护一个字典,其中存储的值作为性能计数器PerfCounter定义如下:
transient class PerfCounter
{
uint2 no; /* PerfReading.values或PerfTimingReading的索引,具体取决于数据类型 */
string name;
string descr;
uint1 datatype;
unique tree<no> no_idx;
};
数据库选项
性能监视器数据库选项在结构体 mco_perf_options_t 中进行了定义,具体如下:
typedef struct _mco_perf_options_tag
{
int enabled;
int monitor_interval_ms;
int monitor_length_sec;
int ui_update_rate_ms;
int store_interval_sec;
} mco_perf_options_t