TSG-14909 tsg-service-chaining-engine的service_function_status metrics适配vsys_id的变更

This commit is contained in:
luwenpeng
2023-04-26 15:04:04 +08:00
parent 989a118969
commit d1b04d50b8
18 changed files with 64 additions and 53 deletions

View File

@@ -9,10 +9,11 @@
#include "utils.h"
#include "sf_status.h"
#define SCE_SF_STATUS "service_function_status,sf_profile_id=%d sf_status=%d,sf_latency_us=%d"
#define SCE_SF_STATUS "service_function_status,vsys_id=%d,sf_profile_id=%d sf_status=%d,sf_latency_us=%d"
struct node
{
int sf_vsys_id;
int sf_profile_id;
int sf_status;
int sf_latency;
@@ -144,7 +145,7 @@ void sf_status_delete(struct sf_status *handle, int sf_profile_id)
}
}
void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status, int sf_latency)
void sf_status_update(struct sf_status *handle, int sf_vsys_id, int sf_profile_id, int sf_status, int sf_latency)
{
if (handle == NULL || handle->config.enable == 0)
{
@@ -159,6 +160,7 @@ void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status
{
LOG_DEBUG("%s: update: sf_profile %d status %d success, elem_num %lu", LOG_TAG_SF_STATUS, sf_profile_id, sf_status, handle->htable_elem_count);
}
temp->sf_vsys_id = sf_vsys_id;
temp->sf_profile_id = sf_profile_id;
temp->sf_status = sf_status;
temp->sf_latency = sf_latency;
@@ -168,6 +170,7 @@ void sf_status_update(struct sf_status *handle, int sf_profile_id, int sf_status
handle->htable_elem_count++;
LOG_DEBUG("%s: insert: sf_profile %d status %d success, elem_num %lu", LOG_TAG_SF_STATUS, sf_profile_id, sf_status, handle->htable_elem_count);
temp = (struct node *)calloc(1, sizeof(struct node));
temp->sf_vsys_id = sf_vsys_id;
temp->sf_profile_id = sf_profile_id;
temp->sf_status = sf_status;
temp->sf_latency = sf_latency;
@@ -194,6 +197,7 @@ void sf_status_send(struct sf_status *handle)
{
memset(buff, 0, size);
nsend = snprintf(buff, size, SCE_SF_STATUS,
node->sf_vsys_id,
node->sf_profile_id,
node->sf_status,
node->sf_latency);