#ifndef _TFE_FIELDSTAT_METRIC_H #define _TFE_FIELDSTAT_METRIC_H #ifdef __cpluscplus extern "C" { #endif #include #include "fieldstat/fieldstat_easy.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_VSYS_ID = 0, TAG_RULE_ID, TAG_ACTION, TAG_SUB_ACTION, TAG_PINNING_STATUS, TAG_MAX }; struct tfe_fieldstat_easy_t { int table_id; int max_thread; struct fieldstat_tag **tags; int counter_array[COLUMN_MAX]; struct fieldstat_easy *fseasy; }; struct tfe_fieldstat_easy_t *tfe_fieldstat_easy_create(char *app_name, char *outpath, int cycle, int max_thread, void *local_logger); void tfe_fieldstat_easy_destroy(struct tfe_fieldstat_easy_t *fieldstat); int tfe_fieldstat_easy_incrby(struct tfe_fieldstat_easy_t *fieldstat, unsigned int counter_id, long long value, const struct fieldstat_tag tags[], int n_tags, int thread_id); #ifdef __cpluscplus } #endif #endif