This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-kni/entry/include/kni_fieldstat.h
2023-06-08 09:45:07 +08:00

65 lines
1.7 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;
uint64_t rule_id;
uint8_t action;
uint8_t pinning_status;
};
// 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,
enum proxy_metrics_column column,
int 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