X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Fhfta%2Fhfta_udaf.h;h=6281859aae52fadf4db73a7eca25a879ffdd3b60;hb=dec9c93423775db0f4783a93145f016d5d780ffd;hp=9f8e6c88e60f8368029a24b925f9bd158b326fb7;hpb=083c44074f33f33368f66739afac9c11a51feb08;p=com%2Fgs-lite.git diff --git a/include/hfta/hfta_udaf.h b/include/hfta/hfta_udaf.h index 9f8e6c8..6281859 100644 --- a/include/hfta/hfta_udaf.h +++ b/include/hfta/hfta_udaf.h @@ -82,24 +82,29 @@ void FIRST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val); void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch); void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch); +void FIRST_HFTA_AGGR_INIT_(gs_int32_t* scratch); +void FIRST_HFTA_AGGR_REINIT_(gs_int32_t* scratch); +void FIRST_HFTA_AGGR_UPDATE_(gs_int32_t* scratch, gs_int32_t val); +void FIRST_HFTA_AGGR_OUTPUT_(gs_int32_t* res, gs_int32_t* scratch); +void FIRST_HFTA_AGGR_DESTROY_(gs_int32_t* scratch); + void FIRST_HFTA_AGGR_INIT_(gs_uint64_t* scratch); void FIRST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); void FIRST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); void FIRST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); void FIRST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); - -void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch); -void FIRST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); -void FIRST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); -void FIRST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); -void FIRST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); - -void FIRST_STR_HFTA_AGGR_INIT_(vstring* scratch); -void FIRST_STR_HFTA_AGGR_REINIT_(vstring* scratch); -void FIRST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); -void FIRST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch); -void FIRST_STR_HFTA_AGGR_DESTROY_(vstring* scratch); +void FIRST_HFTA_AGGR_INIT_(gs_int64_t* scratch); +void FIRST_HFTA_AGGR_REINIT_(gs_int64_t* scratch); +void FIRST_HFTA_AGGR_UPDATE_(gs_int64_t* scratch, gs_int64_t val); +void FIRST_HFTA_AGGR_OUTPUT_(gs_int64_t* res, gs_int64_t* scratch); +void FIRST_HFTA_AGGR_DESTROY_(gs_int64_t* scratch); + +void FIRST_HFTA_AGGR_INIT_(vstring* scratch); +void FIRST_HFTA_AGGR_REINIT_(vstring* scratch); +void FIRST_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); +void FIRST_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch); +void FIRST_HFTA_AGGR_DESTROY_(vstring* scratch); // hfts-lfta split void FIRST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch); void FIRST_hfta_HFTA_AGGR_REINIT_(gs_uint32_t* scratch); @@ -107,12 +112,24 @@ void FIRST_hfta_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val); void FIRST_hfta_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch); void FIRST_hfta_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch); +void FIRST_INT_hfta_HFTA_AGGR_INIT_(gs_int32_t* scratch); +void FIRST_INT_hfta_HFTA_AGGR_REINIT_(gs_int32_t* scratch); +void FIRST_INT_hfta_HFTA_AGGR_UPDATE_(gs_int32_t* scratch, gs_int32_t val); +void FIRST_INT_hfta_HFTA_AGGR_OUTPUT_(gs_int32_t* res, gs_int32_t* scratch); +void FIRST_INT_hfta_HFTA_AGGR_DESTROY_(gs_int32_t* scratch); + void FIRST_ULL_hfta_HFTA_AGGR_INIT_(gs_uint64_t* scratch); void FIRST_ULL_hfta_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); void FIRST_ULL_hfta_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); void FIRST_ULL_hfta_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); void FIRST_ULL_hfta_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); +void FIRST_LL_hfta_HFTA_AGGR_INIT_(gs_int64_t* scratch); +void FIRST_LL_hfta_HFTA_AGGR_REINIT_(gs_int64_t* scratch); +void FIRST_LL_hfta_HFTA_AGGR_UPDATE_(gs_int64_t* scratch, gs_int64_t val); +void FIRST_LL_hfta_HFTA_AGGR_OUTPUT_(gs_int64_t* res, gs_int64_t* scratch); +void FIRST_LL_hfta_HFTA_AGGR_DESTROY_(gs_int64_t* scratch); + void FIRST_STR_hfta_HFTA_AGGR_INIT_(vstring* scratch); void FIRST_STR_hfta_HFTA_AGGR_REINIT_(vstring* scratch); void FIRST_STR_hfta_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); @@ -127,23 +144,30 @@ void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val); void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch); void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch); +void LAST_HFTA_AGGR_INIT_(gs_int32_t* scratch); +void LAST_HFTA_AGGR_REINIT_(gs_int32_t* scratch); +void LAST_HFTA_AGGR_UPDATE_(gs_int32_t* scratch, gs_int32_t val); +void LAST_HFTA_AGGR_OUTPUT_(gs_int32_t* res, gs_int32_t* scratch); +void LAST_HFTA_AGGR_DESTROY_(gs_int32_t* scratch); + void LAST_HFTA_AGGR_INIT_(gs_uint64_t* scratch); void LAST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); void LAST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); void LAST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); void LAST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); -void LAST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch); -void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); -void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); -void LAST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); -void LAST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); +void LAST_HFTA_AGGR_INIT_(gs_int64_t* scratch); +void LAST_HFTA_AGGR_REINIT_(gs_int64_t* scratch); +void LAST_HFTA_AGGR_UPDATE_(gs_int64_t* scratch, gs_int64_t val); +void LAST_HFTA_AGGR_OUTPUT_(gs_int64_t* res, gs_int64_t* scratch); +void LAST_HFTA_AGGR_DESTROY_(gs_int64_t* scratch); + +void LAST_HFTA_AGGR_INIT_(vstring* scratch); +void LAST_HFTA_AGGR_REINIT_(vstring* scratch); +void LAST_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); +void LAST_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch); +void LAST_HFTA_AGGR_DESTROY_(vstring* scratch); -void LAST_STR_HFTA_AGGR_INIT_(vstring* scratch); -void LAST_STR_HFTA_AGGR_REINIT_(vstring* scratch); -void LAST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); -void LAST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch); -void LAST_STR_HFTA_AGGR_DESTROY_(vstring* scratch); // hfta/lfta split void LAST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch); @@ -152,19 +176,96 @@ void LAST_hfta_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val); void LAST_hfta_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch); void LAST_hfta_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch); +void LAST_INT_hfta_HFTA_AGGR_INIT_(gs_int32_t* scratch); +void LAST_INT_hfta_HFTA_AGGR_REINIT_(gs_int32_t* scratch); +void LAST_INT_hfta_HFTA_AGGR_UPDATE_(gs_int32_t* scratch, gs_int32_t val); +void LAST_INT_hfta_HFTA_AGGR_OUTPUT_(gs_int32_t* res, gs_int32_t* scratch); +void LAST_INT_hfta_HFTA_AGGR_DESTROY_(gs_int32_t* scratch); + void LAST_ULL_hfta_HFTA_AGGR_INIT_(gs_uint64_t* scratch); void LAST_ULL_hfta_HFTA_AGGR_REINIT_(gs_uint64_t* scratch); void LAST_ULL_hfta_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val); void LAST_ULL_hfta_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch); void LAST_ULL_hfta_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch); +void LAST_LL_hfta_HFTA_AGGR_INIT_(gs_int64_t* scratch); +void LAST_LL_hfta_HFTA_AGGR_REINIT_(gs_int64_t* scratch); +void LAST_LL_hfta_HFTA_AGGR_UPDATE_(gs_int64_t* scratch, gs_int64_t val); +void LAST_LL_hfta_HFTA_AGGR_OUTPUT_(gs_int64_t* res, gs_int64_t* scratch); +void LAST_LL_hfta_HFTA_AGGR_DESTROY_(gs_int64_t* scratch); + void LAST_STR_hfta_HFTA_AGGR_INIT_(vstring* scratch); void LAST_STR_hfta_HFTA_AGGR_REINIT_(vstring* scratch); void LAST_STR_hfta_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val); void LAST_STR_hfta_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch); void LAST_STR_hfta_HFTA_AGGR_DESTROY_(vstring* scratch); +/////////////////////////////////////////////////////////////// +// count_diff aggregate +/////////////////////////////////////////////////////////////// + +void count_diff_HFTA_AGGR_INIT_(gs_sp_t scratch); +void count_diff_HFTA_AGGR_REINIT_(gs_sp_t scratch); +void count_diff_HFTA_AGGR_UPDATE_(gs_sp_t scratch, gs_uint32_t val); +void count_diff_HFTA_AGGR_UPDATE_(gs_sp_t scratch, gs_int32_t val); +void count_diff_HFTA_AGGR_UPDATE_(gs_sp_t scratch, gs_uint64_t val); +void count_diff_HFTA_AGGR_UPDATE_(gs_sp_t scratch, gs_int64_t val); +void count_diff_HFTA_AGGR_UPDATE_(gs_sp_t scratch, vstring *val); +void count_diff_HFTA_AGGR_OUTPUT_(gs_uint32_t *res, gs_sp_t scratch); +void count_diff_HFTA_AGGR_DESTROY_(gs_sp_t scratch); + +void count_diff_hfta_HFTA_AGGR_INIT_(gs_sp_t s); +void count_diff_hfta_HFTA_AGGR_REINIT_(gs_sp_t s); +void count_diff_hfta_HFTA_AGGR_UPDATE_(gs_sp_t s, vstring *val); +void count_diff_hfta_HFTA_AGGR_OUTPUT_(gs_uint32_t *res, gs_sp_t s); +void count_diff_hfta_HFTA_AGGR_DESTROY_(gs_sp_t scratch); + +////////////////////////////////////////////// +// CAT_aggr, aggregate strings by catenation +////////////////////////////////////////////// +void CAT_aggr_HFTA_AGGR_INIT_(gs_sp_t s); +void CAT_aggr_HFTA_AGGR_REINIT_(gs_sp_t s); +void CAT_aggr_HFTA_AGGR_UPDATE_(gs_sp_t s, vstring *sep, vstring *str); +void CAT_aggr_HFTA_AGGR_OUTPUT_(vstring *res, gs_sp_t s); +void CAT_aggr_HFTA_AGGR_DESTROY_(gs_sp_t s); + +///////////////////////////////////////////////////////// +// time-averaged sum, from aperiodic reports +//////////////////////////////////////////////////////// + +void time_avg_HFTA_AGGR_INIT_(gs_sp_t s); +void time_avg_HFTA_AGGR_DESTROY_(gs_sp_t s); +void time_avg_HFTA_AGGR_REINIT_(gs_sp_t s); +void time_avg_HFTA_AGGR_OUTPUT_(gs_float_t *result, gs_sp_t s); +void time_avg_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_float_t val, gs_int64_t ts, gs_int64_t window); +void time_avg_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_uint32_t val, gs_int64_t ts, gs_int64_t window); +void time_avg_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_int32_t val, gs_int64_t ts, gs_int64_t window); +void time_avg_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_uint64_t val, gs_int64_t ts, gs_int64_t window); +void time_avg_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_int64_t val, gs_int64_t ts, gs_int64_t window); + +// ------------------------------------------------------------ +// running_sum_max : get the running sum of an int, +// be able to report this sum and also its max value +// during the time window +// ------------------------------------------------------------ + +void run_sum_max_HFTA_AGGR_INIT_(gs_sp_t s); +void run_sum_max_HFTA_AGGR_REINIT_(gs_sp_t s); +void run_sum_max_HFTA_AGGR_OUTPUT_(vstring *r,gs_sp_t b); +void run_sum_max_HFTA_AGGR_DESTROY_(gs_sp_t b); +void run_sum_max_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_uint64_t v); +void run_sum_max_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_int64_t v); +void run_sum_max_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_uint32_t v); +void run_sum_max_HFTA_AGGR_UPDATE_(gs_sp_t s, gs_int32_t v); +gs_int64_t extr_running_sum(vstring *v); +gs_int64_t extr_running_sum_max(vstring *v); + + + + +/////////////////////////////////////////////////////////////// // running_array_aggr aggregate +/////////////////////////////////////////////////////////////// void running_array_aggr_hfta_HFTA_AGGR_INIT_(vstring* scratch); void running_array_aggr_hfta_HFTA_AGGR_REINIT_(vstring* scratch); void running_array_aggr_hfta_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val);