| 
    CNDP
    22.08.0
    
   | 
 
Go to the source code of this file.
Macros | |
| #define | metrics_append(c, fmt, ...) | 
Functions | |
| CNDP_API int | metrics_register (const char *cmd, metrics_cb fn) | 
| CNDP_API int | metrics_init (void *priv_) | 
| CNDP_API int | metrics_destroy (void) | 
| CNDP_API const char * | metrics_cmd (metrics_client_t *client) | 
| CNDP_API const char * | metrics_params (metrics_client_t *client) | 
| CNDP_API int | metrics_port_stats (metrics_client_t *c, char *name, lport_stats_t *s) | 
Metrics-related utility functions
Definition in file metrics.h.
| #define metrics_append | ( | c, | |
| fmt, | |||
| ... | |||
| ) | 
A snprintf() like routine to add text or data to the output buffer.
| c | The client pointer that holds the buffer to append the text data. | 
| fmt | The snprintf() like format string with variable arguments | 
| ... | Arguments for the format string to use | 
| CNDP_API int metrics_register | ( | const char * | cmd, | 
| metrics_cb | fn | ||
| ) | 
Register a new command to the metrics interface
| cmd | The command string including the '/' e.g. '/pktdev:stats' | 
| fn | The function to callback for this command | 
| CNDP_API int metrics_init | ( | void * | priv_ | ) | 
Initialize metrics library.
| priv_ | Pointer to metrics command group private data. | 
| CNDP_API int metrics_destroy | ( | void | ) | 
Remove all registered metrics commands.
| CNDP_API const char* metrics_cmd | ( | metrics_client_t * | client | ) | 
Return the command string pointer
| client | The client structure pointer | 
| CNDP_API const char* metrics_params | ( | metrics_client_t * | client | ) | 
Return the params string pointer
| client | The client structure pointer | 
| CNDP_API int metrics_port_stats | ( | metrics_client_t * | c, | 
| char * | name, | ||
| lport_stats_t * | s | ||
| ) | 
Add the standard lport statistics to the metrics buffer
| c | The metric_client_t structure pointer | 
| name | The name of the lport as a prefix to the stats names. | 
| s | The lport_stats_t structure pointer |