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-tfe/common/include/tfe_fieldstat.h

50 lines
1.0 KiB
C
Raw Normal View History

#ifndef _TFE_FIELDSTAT_METRIC_H
#define _TFE_FIELDSTAT_METRIC_H
#ifdef __cpluscplus
extern "C"
{
#endif
#include <tfe_utils.h>
#include <MESA/fieldstat.h>
enum metric_columns_index
{
COLUMN_HIT_COUNT = 0,
COLUMN_IN_BYTES,
COLUMN_OUT_BYTES,
COLUMN_IN_PKTS,
COLUMN_OUT_PKTS,
COLUMN_MAX
};
enum metric_tags_index
{
TAG_RULE_ID = 0,
TAG_PINNING_STATUS,
TAG_ACTION,
TAG_SUB_ACTION,
TAG_MAX
};
struct tfe_fieldstat_metric_t
{
int table_id;
int max_thread;
struct fieldstat_tag **tags;
unsigned int column_array[COLUMN_MAX];
struct fieldstat_dynamic_instance *instance;
};
int tfe_fieldstat_metric_incrby(struct tfe_fieldstat_metric_t *fieldstat, unsigned int column_id, long long value, const struct fieldstat_tag tags[], int thread_id);
struct tfe_fieldstat_metric_t *tfe_fieldstat_metric_create(char *telegraf_ip, int telegraf_port, char *app_name, int cycle, int max_thread, void *local_logger);
void tfe_fieldstat_metric_destroy(struct tfe_fieldstat_metric_t *fieldstat);
#ifdef __cpluscplus
}
#endif
#endif