55 lines
1.3 KiB
C
55 lines
1.3 KiB
C
|
|
#ifndef _GLOBAL_METRICS_H
|
||
|
|
#define _GLOBAL_METRICS_H
|
||
|
|
|
||
|
|
#ifdef __cpluscplus
|
||
|
|
extern "C"
|
||
|
|
{
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#include "utils.h"
|
||
|
|
#include <MESA/field_stat2.h>
|
||
|
|
|
||
|
|
struct global_metrics_config
|
||
|
|
{
|
||
|
|
char output_file[256];
|
||
|
|
char statsd_server[32];
|
||
|
|
int statsd_port;
|
||
|
|
int statsd_format;
|
||
|
|
int statsd_cycle;
|
||
|
|
|
||
|
|
int prometheus_listen_port;
|
||
|
|
char prometheus_listen_url[256];
|
||
|
|
};
|
||
|
|
|
||
|
|
struct global_metrics
|
||
|
|
{
|
||
|
|
struct throughput_metrics dev_endpoint_rx; // 累计值
|
||
|
|
struct throughput_metrics dev_endpoint_tx; // 累计值
|
||
|
|
struct throughput_metrics dev_endpoint_err_drop; // 累计值
|
||
|
|
|
||
|
|
struct throughput_metrics dev_nf_interface_rx; // 累计值
|
||
|
|
struct throughput_metrics dev_nf_interface_tx; // 累计值
|
||
|
|
struct throughput_metrics dev_nf_interface_err_bypass; // 累计值
|
||
|
|
|
||
|
|
struct throughput_metrics hit_block_policy; // 累计值
|
||
|
|
struct throughput_metrics hit_bypass_policy; // 累计值
|
||
|
|
|
||
|
|
struct throughput_metrics control_packet_rx; // 累计值
|
||
|
|
|
||
|
|
uint64_t session_nums; // 瞬时值
|
||
|
|
|
||
|
|
struct global_metrics_config config;
|
||
|
|
screen_stat_handle_t fs_handle;
|
||
|
|
int fs_id[32];
|
||
|
|
};
|
||
|
|
|
||
|
|
struct global_metrics *global_metrics_create(const char *profile);
|
||
|
|
void global_metrics_destory(struct global_metrics *metrics);
|
||
|
|
void global_metrics_dump(struct global_metrics *metrics);
|
||
|
|
|
||
|
|
#ifdef __cpluscplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif
|