summaryrefslogtreecommitdiff
path: root/shaping/include/shaper_stat.h
diff options
context:
space:
mode:
authorroot <[email protected]>2024-07-19 10:02:16 +0000
committerroot <[email protected]>2024-07-19 10:02:16 +0000
commit782ee7558dc53f308edd9c0ad1813d43bb22b33c (patch)
tree5b498dd644f91b40635c446f5580fd568b2e2e2a /shaping/include/shaper_stat.h
parent50c554ee4ec2ae89cba124605775995f8afeb34f (diff)
update to fieldstat4, not complete
Diffstat (limited to 'shaping/include/shaper_stat.h')
-rw-r--r--shaping/include/shaper_stat.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/shaping/include/shaper_stat.h b/shaping/include/shaper_stat.h
index e6feeb3..124757c 100644
--- a/shaping/include/shaper_stat.h
+++ b/shaping/include/shaper_stat.h
@@ -1,8 +1,8 @@
#pragma once
#include <netinet/in.h>
+#include <librdkafka/rdkafka.h>
#include "uthash.h"
-#include <fieldstat.h>
enum shaping_packet_dir {
SHAPING_DIR_IN = 0,
@@ -20,9 +20,7 @@ enum shaping_stat_tags_index {
};
enum shaping_stat_column_index {
- IN_MAX_LATENCY_IDX = 0,
- IN_QUEUE_LEN_IDX,
- OUT_MAX_LATENCY_IDX,
+ IN_QUEUE_LEN_IDX = 0,
OUT_QUEUE_LEN_IDX,
IN_PKTS_IDX,
IN_BYTES_IDX,
@@ -47,8 +45,12 @@ struct shaping_stat_for_profile {
};
struct shaping_stat {
- struct fieldstat_dynamic_instance *instance;
- int table_id;
+ struct fieldstat_easy *instance;
+ rd_kafka_t *kafka_handle;
+ rd_kafka_topic_t *topic_rkt;
+ int output_interval_s;
+ int in_latency_histogram_id;
+ int out_latency_histogram_id;
unsigned int column_ids[STAT_COLUNM_IDX_MAX];
};
@@ -65,4 +67,6 @@ void shaper_stat_drop_inc(struct shaping_stat_for_profile *profile_stat, unsigne
void shaper_stat_max_latency_update(struct shaping_stat_for_profile *profile_stat, unsigned char direction, unsigned long long latency, int thread_id);
void shaper_stat_refresh(struct shaping_thread_ctx *ctx, struct shaping_flow *sf, int force);
-void shaper_stat_priority_queue_len_refresh_all(struct shaping_thread_ctx *ctx, struct shaping_profile_hash_node *profile_hash_node); \ No newline at end of file
+void shaper_stat_priority_queue_len_refresh_all(struct shaping_thread_ctx *ctx, struct shaping_profile_hash_node *profile_hash_node);
+
+void shaper_stat_output(struct shaping_stat *stat); \ No newline at end of file