76 lines
1.8 KiB
C
76 lines
1.8 KiB
C
#ifndef _KNI_FIELDSTAT_METRIC_H
|
|
#define _KNI_FIELDSTAT_METRIC_H
|
|
|
|
#ifdef __cpluscplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
#include <MESA/fieldstat.h>
|
|
|
|
|
|
enum proxy_metrics_column
|
|
{
|
|
PROXY_METRIC_COLUMN_HIT_COUNT = 0,
|
|
PROXY_METRIC_COLUMN_IN_BYTES,
|
|
PROXY_METRIC_COLUMN_OUT_BYTES,
|
|
PROXY_METRIC_COLUMN_IN_PKTS,
|
|
PROXY_METRIC_COLUMN_OUT_PKTS,
|
|
PROXY_METRIC_COLUMN_MAX
|
|
};
|
|
|
|
|
|
struct proxy_fieldstat
|
|
{
|
|
int table_id;
|
|
int n_thread;
|
|
unsigned int column_ids[PROXY_METRIC_COLUMN_MAX];
|
|
struct fieldstat_dynamic_instance *instance;
|
|
};
|
|
|
|
struct proxy_metric_tag
|
|
{
|
|
int vsys_id;
|
|
unsigned long long rule_id;
|
|
unsigned char action;
|
|
unsigned char pinning_status;
|
|
};
|
|
|
|
|
|
struct proxy_metric_value
|
|
{
|
|
int hit_count;
|
|
int in_bytes;
|
|
int out_bytes;
|
|
int in_pkts;
|
|
int out_pkts;
|
|
};
|
|
|
|
|
|
// struct proxy_fieldstat *proxy_fieldstat_new(char *app_name, int n_thread,
|
|
// int interval_ms,
|
|
// const char *telegraf_ip,
|
|
// unsigned short telegraf_port,
|
|
// void *local_logger);
|
|
|
|
// void proxy_fieldstat_free(struct proxy_fieldstat *pxy_fs);
|
|
|
|
void proxy_set_metric_value(struct proxy_fieldstat *pxy_fs,
|
|
struct proxy_metric_tag *metric_tags,
|
|
struct proxy_metric_value *metric_value,
|
|
int thread_id);
|
|
|
|
struct proxy_fieldstat *proxy_fieldstat_init(const char *profile,
|
|
const char *section,
|
|
int n_thread,
|
|
void *logger);
|
|
|
|
void proxy_fieldstat_destory(struct proxy_fieldstat *pxy_fs, void *logger);
|
|
#ifdef __cpluscplus
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|