NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
telemetry_export_sample.c File Reference
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <doca_log.h>
#include <doca_telemetry_exporter.h>
Include dependency graph for telemetry_export_sample.c:

Go to the source code of this file.

Data Structures

struct  test_event_type
 

Macros

#define NB_EXAMPLE_STRINGS   5 /* Amount of example strings */
 
#define MAX_EXAMPLE_STRING_SIZE   256 /* Indicates the max length of string */
 
#define SINGLE_FIELD_VALUE   1 /* Indicates the field contains one value */
 

Functions

 DOCA_LOG_REGISTER (TELEMETRY_EXPORTER)
 
struct test_event_type __attribute__ ((packed))
 
static doca_error_t prepare_example_event (int32_t iter_number, uint64_t string_number, struct test_event_type *event)
 
static doca_error_t telemetry_register_fields (struct doca_telemetry_exporter_type *type)
 
doca_error_t telemetry_export (void)
 

Variables

static char * example_strings [NB_EXAMPLE_STRINGS]
 
doca_telemetry_exporter_timestamp_t timestamp
 
int32_t event_number
 
int32_t iter_number
 
uint64_t string_number
 
char example_string [MAX_EXAMPLE_STRING_SIZE]
 

Macro Definition Documentation

◆ MAX_EXAMPLE_STRING_SIZE

#define MAX_EXAMPLE_STRING_SIZE   256 /* Indicates the max length of string */

Definition at line 40 of file telemetry_export_sample.c.

◆ NB_EXAMPLE_STRINGS

#define NB_EXAMPLE_STRINGS   5 /* Amount of example strings */

Definition at line 39 of file telemetry_export_sample.c.

◆ SINGLE_FIELD_VALUE

#define SINGLE_FIELD_VALUE   1 /* Indicates the field contains one value */

Definition at line 41 of file telemetry_export_sample.c.

Function Documentation

◆ __attribute__()

struct test_event_type __attribute__ ( (packed)  )

Definition at line 1 of file telemetry_exporter.h.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( TELEMETRY_EXPORTER  )

◆ prepare_example_event()

static doca_error_t prepare_example_event ( int32_t  iter_number,
uint64_t  string_number,
struct test_event_type event 
)
static

Definition at line 69 of file telemetry_export_sample.c.

◆ telemetry_export()

doca_error_t telemetry_export ( void  )

Definition at line 139 of file telemetry_export_sample.c.

◆ telemetry_register_fields()

static doca_error_t telemetry_register_fields ( struct doca_telemetry_exporter_type *  type)
static

Definition at line 95 of file telemetry_export_sample.c.

Variable Documentation

◆ event_number

int32_t event_number

Definition at line 1 of file telemetry_export_sample.c.

◆ example_string

char example_string[MAX_EXAMPLE_STRING_SIZE]

Definition at line 4 of file telemetry_export_sample.c.

◆ example_strings

char* example_strings[NB_EXAMPLE_STRINGS]
static
Initial value:
= {"example_str_1",
"example_str_2",
"example_str_3",
"example_str_4",
"example_str_5"}

Definition at line 45 of file telemetry_export_sample.c.

◆ iter_number

int32_t iter_number

Definition at line 2 of file telemetry_export_sample.c.

◆ string_number

uint64_t string_number

Definition at line 3 of file telemetry_export_sample.c.

◆ timestamp

Definition at line 0 of file telemetry_export_sample.c.