DPDK statistics
Overview
TAPI to handle DPDK-related operations with statistics
Copyright (C) 2019-2022 OKTET Labs Ltd. More…
// global functions void tapi_dpdk_stats_pps_artifact(te_mi_logger* logger, int64_t pps, const char* prefix); uint64_t tapi_dpdk_stats_calculate_l1_bitrate(uint64_t pps, unsigned int packet_size); te_errno tapi_dpdk_stats_calculate_l1_link_usage(uint64_t l1_bitrate, unsigned int link_speed, double* l1_link_usage); void tapi_dpdk_stats_l1_bitrate_artifact(te_mi_logger* logger, uint64_t l1_bitrate, const char* prefix); void tapi_dpdk_stats_l1_link_usage_artifact(te_mi_logger* logger, double l1_link_usage, const char* prefix); void tapi_dpdk_stats_cv_artifact(te_mi_logger* logger, double cv, const char* prefix); te_errno tapi_dpdk_stats_summary_artifact(const te_meas_stats_t* meas_stats, const char* prefix); void tapi_dpdk_stats_stab_artifact(te_mi_logger* logger, const te_meas_stats_t* meas_stats, const char* prefix); static const te_meas_stats_data_t* tapi_dpdk_stats_get_rate_data(const te_meas_stats_t* meas_stats); te_errno tapi_dpdk_stats_log_rates(const char* tool, const te_meas_stats_t* meas_stats, unsigned int packet_size, unsigned int link_speed, const char* prefix); te_errno tapi_dpdk_stats_log_aggr_rates(const char* tool, unsigned int n_meas_stats, const te_meas_stats_t* meas_stats, unsigned int packet_size, unsigned int* link_speed, const char* prefix); // macros #define TAPI_DPDK_STATS_GATHERED_RING(title, N, fmt_str, ...)
Detailed Documentation
TAPI to handle DPDK-related operations with statistics
Copyright (C) 2019-2022 OKTET Labs Ltd. All rights reserved.
Global Functions
void tapi_dpdk_stats_pps_artifact(te_mi_logger* logger, int64_t pps, const char* prefix)
Report packet per second statistics as a test artifact.
Parameters:
logger |
MI logger entity to add artifact into (may be |
pps |
Packets per second |
prefix |
Prefix of the artifact message (may be |
Returns:
Status code
uint64_t tapi_dpdk_stats_calculate_l1_bitrate(uint64_t pps, unsigned int packet_size)
Calculate layer 1 bits per second from PPS and packet size.
Parameters:
pps |
Packets per second |
packet_size |
Packet size in bytes (without l1 and FCS) |
Returns:
Layer 1 bits per second
te_errno tapi_dpdk_stats_calculate_l1_link_usage(uint64_t l1_bitrate, unsigned int link_speed, double* l1_link_usage)
Calculate layer 1 link usage from layer 1 bitrate and link speed.
Parameters:
l1_bitrate |
Layer 1 bits per second |
link_speed |
Link speed in Mbps |
l1_link_usage |
Layer 1 link usage ratio |
Returns:
Status code
void tapi_dpdk_stats_l1_bitrate_artifact(te_mi_logger* logger, uint64_t l1_bitrate, const char* prefix)
Report packet per second statistics as a test artifact.
Parameters:
logger |
MI logger entity to add artifact into (may be |
l1_bitrate |
Layer 1 bits per second |
prefix |
Prefix of the artifact message (may be |
Returns:
Status code
void tapi_dpdk_stats_l1_link_usage_artifact(te_mi_logger* logger, double l1_link_usage, const char* prefix)
Report layer 1 link usage statistics as a test artifact.
Parameters:
logger |
MI logger entity to add artifact into (may be |
l1_link_usage |
Layer 1 link usage ratio |
prefix |
Prefix of the artifact message (may be |
Returns:
Status code
void tapi_dpdk_stats_cv_artifact(te_mi_logger* logger, double cv, const char* prefix)
Report CV of packer per second statistics as a test artifact
Parameters:
logger |
MI logger entity to add artifact into (may be |
cv |
Coefficient of variation |
prefix |
Prefix of the artifact message (may be |
Returns:
Status code
te_errno tapi_dpdk_stats_summary_artifact(const te_meas_stats_t* meas_stats, const char* prefix)
Report statistics provided by te_meas_stats_summary_t.
Parameters:
meas_stats |
Pointer to te_meas_stats_t structure |
prefix |
Prefix of the artifact message (may be |
0 |
Summary is logged successfully. |
TE_EINVAL |
Measurement statistics are not specified. |
TE_ENODATA |
The sample contains no measurements. |
TE_EFAULT |
Summary is unavailable or does not match the sample. |
TE_EDOM |
Relative statistics are undefined for a zero mean. |
Returns:
Other status code on failure.
void tapi_dpdk_stats_stab_artifact(te_mi_logger* logger, const te_meas_stats_t* meas_stats, const char* prefix)
Report statistics provided by te_meas_stats_stab_t.
Parameters:
logger |
MI logger entity to add artifact into (may be |
meas_stats |
Pointer to te_meas_stats_t structure |
prefix |
Prefix of the artifact message (may be |
static const te_meas_stats_data_t* tapi_dpdk_stats_get_rate_data(const te_meas_stats_t* meas_stats)
Get the sample used to report rate statistics.
Prefer the filtered sample when it is available. Otherwise, use the measurements collected so far.
Parameters:
meas_stats |
Measurement statistics (may be |
Returns:
Selected sample or NULL if meas_stats is NULL.
te_errno tapi_dpdk_stats_log_rates(const char* tool, const te_meas_stats_t* meas_stats, unsigned int packet_size, unsigned int link_speed, const char* prefix)
Report rates corresponding to PPS, packet_size and link speed as test artifacts.
A zero rate is reported as a valid measurement, but CV and summary are omitted in this case because calculating them requires a non-zero mean.
Parameters:
tool |
Tool used for measurement gathering (must not be |
meas_stats |
Pointer to te_meas_stats_t structure |
packet_size |
Packet size in bytes (without l1 and FCS) |
link_speed |
Link speed in Mbps |
prefix |
Prefix of artifact messages (may be |
0 |
Statistics are logged successfully. |
TE_EINVAL |
Measurement statistics are not specified. |
TE_ENODATA |
The selected sample contains no measurements. |
Returns:
Other status code on failure.
te_errno tapi_dpdk_stats_log_aggr_rates(const char* tool, unsigned int n_meas_stats, const te_meas_stats_t* meas_stats, unsigned int packet_size, unsigned int* link_speed, const char* prefix)
Report aggregate rates corresponding to PPS, packet_size and link speed as test artifacts when many ports were tested.
Parameters:
tool |
Tool used for measurement gathering (must not be |
n_meas_stats |
Number of elements in |
meas_stats |
Array of measurement statistics |
packet_size |
Packet size in bytes (without L1 and FCS) |
link_speed |
Array of link speeds in Mbps |
prefix |
Prefix of artifact messages (may be |
0 |
Aggregate rates are logged successfully. |
TE_ENODATA |
At least one selected sample is empty. |
Returns:
Other status code on failure.