TSG-13626 tsg-service-chaining-engine发送Metrics
This commit is contained in:
@@ -19,6 +19,7 @@ struct thread_ctx
|
||||
pthread_t tid;
|
||||
int thread_index;
|
||||
struct session_table *session_table;
|
||||
struct sf_metrics *sf_metrics;
|
||||
|
||||
struct packet_io *ref_io;
|
||||
struct global_metrics *ref_metrics;
|
||||
@@ -26,6 +27,7 @@ struct thread_ctx
|
||||
struct sce_ctx *ref_sce_ctx;
|
||||
|
||||
int session_table_need_reset;
|
||||
int sf_metrics_need_send;
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
24
platform/include/sf_metrics.h
Normal file
24
platform/include/sf_metrics.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _SF_METRICS_H
|
||||
#define _SF_METRICS_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include "uthash.h"
|
||||
|
||||
struct sf_metrics *sf_metrics_create(const char *profile);
|
||||
void sf_metrics_destory(struct sf_metrics *handle);
|
||||
void sf_metrics_reset(struct sf_metrics *handle);
|
||||
|
||||
void sf_metrics_inc(struct sf_metrics *handle, int rule_id, int sff_profile_id, int sf_profile_id, uint64_t rx_pkts, uint64_t rx_bytes, uint64_t tx_pkts, uint64_t tx_bytes);
|
||||
void sf_metrics_send(struct sf_metrics *handle);
|
||||
int sf_metrics_get_interval(struct sf_metrics *handle);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
24
platform/include/sf_status.h
Normal file
24
platform/include/sf_status.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _SF_STATUS_H
|
||||
#define _SF_STATUS_H
|
||||
|
||||
#ifdef __cpluscplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include "uthash.h"
|
||||
|
||||
struct sf_status *sf_status_create(const char *profile);
|
||||
void sf_status_destory(struct sf_status *handle);
|
||||
void sf_status_reset(struct sf_status *handle);
|
||||
|
||||
void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status, int sf_latency);
|
||||
void sf_status_send(struct sf_status *handle);
|
||||
int sf_status_get_interval(struct sf_status *handle);
|
||||
|
||||
#ifdef __cpluscplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user