Network statistics access

Overview

// typedefs

typedef struct tapi_cfg_if_stats tapi_cfg_if_stats;
typedef struct tapi_cfg_if_xstat tapi_cfg_if_xstat;
typedef struct tapi_cfg_if_xstats tapi_cfg_if_xstats;
typedef struct tapi_cfg_if_irq_per_cpu tapi_cfg_if_irq_per_cpu;
typedef struct tapi_cfg_if_irq_stats tapi_cfg_if_irq_stats;
typedef struct tapi_cfg_net_stats_ipv4 tapi_cfg_net_stats_ipv4;
typedef struct tapi_cfg_net_stats_icmp tapi_cfg_net_stats_icmp;
typedef struct tapi_cfg_net_stats tapi_cfg_net_stats;

// structs

struct tapi_cfg_if_irq_per_cpu;
struct tapi_cfg_if_irq_stats;
struct tapi_cfg_if_stats;
struct tapi_cfg_if_xstat;
struct tapi_cfg_if_xstats;
struct tapi_cfg_net_stats;
struct tapi_cfg_net_stats_icmp;
struct tapi_cfg_net_stats_ipv4;

// global variables

te_vec_item_destroy_fn tapi_cfg_stats_free_irqs_vec;

// global functions

te_errno tapi_cfg_stats_if_stats_get(const char* ta, const char* ifname, tapi_cfg_if_stats* stats);
te_errno tapi_cfg_stats_if_stats_print(const char* ta, const char* ifname, tapi_cfg_if_stats* stats);
te_errno tapi_cfg_stats_if_stats_print_diff(const tapi_cfg_if_stats* stats, const tapi_cfg_if_stats* prev, const char* descr_fmt, ...);
te_errno te_errno tapi_cfg_stats_if_xstats_get(const char* ta, const char* ifname, tapi_cfg_if_xstats* stats);
te_errno tapi_cfg_stats_if_xstats_print_diff(const tapi_cfg_if_xstats* stats, const tapi_cfg_if_xstats* prev, const char* descr_fmt, ...);
te_errno te_errno tapi_cfg_stats_if_xstats_print(const char* ta, const char* ifname, tapi_cfg_if_xstats* xstats);
te_errno tapi_cfg_stats_if_irq_stats_get(const char* ta, const char* ifname, te_vec* irq_stats);
te_errno tapi_cfg_stats_if_irq_print_diff(const te_vec* stats, const te_vec* prev, const char* descr_fmt, ...);
te_errno te_errno tapi_cfg_stats_if_irq_print(const char* ta, const char* ifname, te_vec* irq_stats);
te_errno tapi_cfg_stats_net_stats_get(const char* ta, tapi_cfg_net_stats* stats);
te_errno tapi_cfg_stats_net_stats_print(const char* ta, tapi_cfg_net_stats* stats);
te_errno tapi_cfg_stats_net_stats_print_diff(const tapi_cfg_net_stats* stats, const tapi_cfg_net_stats* prev, const char* descr_fmt, ...);

Detailed Documentation

Global Variables

te_vec_item_destroy_fn tapi_cfg_stats_free_irqs_vec

Release sources grabbed for IRQ per CPU statistics.

Global Functions

te_errno tapi_cfg_stats_if_stats_get(const char* ta, const char* ifname, tapi_cfg_if_stats* stats)

Get IfTable statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

stats

Resulted interface statistics structure

Returns:

Status code

te_errno tapi_cfg_stats_if_stats_print(const char* ta, const char* ifname, tapi_cfg_if_stats* stats)

Print IfTable statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

stats

Gathered interface statistics structure to print

Returns:

Status code

te_errno tapi_cfg_stats_if_stats_print_diff(const tapi_cfg_if_stats* stats, const tapi_cfg_if_stats* prev, const char* descr_fmt, ...)

Print IfTable statistics difference with provided description.

Parameters:

stats

Interface statistics.

prev

Previous interface statistics or NULL.

descr_fmt

Description format string with arguments.

Returns:

Status code.

te_errno te_errno tapi_cfg_stats_if_xstats_get(const char* ta, const char* ifname, tapi_cfg_if_xstats* stats)

Get ethtool statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

xstats

Resulted interface extended statistics structure

Returns:

Status code

te_errno tapi_cfg_stats_if_xstats_print_diff(const tapi_cfg_if_xstats* stats, const tapi_cfg_if_xstats* prev, const char* descr_fmt, ...)

Print ethtool statistics difference with provided description.

Parameters:

stats

Interface statistics from ethtool.

prev

Previous interface statistics from ethtool or NULL.

descr_fmt

Description format string with arguments.

Returns:

Status code.

te_errno te_errno tapi_cfg_stats_if_xstats_print(const char* ta, const char* ifname, tapi_cfg_if_xstats* xstats)

Print ethtool statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

stats

Gathered extended interface statistics structure to print

Returns:

Status code

te_errno tapi_cfg_stats_if_irq_stats_get(const char* ta, const char* ifname, te_vec* irq_stats)

Get IRQ per CPU statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

irq_stats

Resulted IRQ per CPU statistics structure

Returns:

Status code

te_errno tapi_cfg_stats_if_irq_print_diff(const te_vec* stats, const te_vec* prev, const char* descr_fmt, ...)

Print IRQ per CPU difference with provided description.

Parameters:

stats

IRQ per CPU statistics

prev

Previous IRQ per CPU statistics NULL

descr_fmt

Description format string with arguments

Returns:

Status code

te_errno te_errno tapi_cfg_stats_if_irq_print(const char* ta, const char* ifname, te_vec* irq_stats)

Print IRQ per CPU statistics for the certain network interface.

Parameters:

ta

Test Agent to gather statistics on

ifname

Network interface to gather statistics of

irq_stats

Gathered IRQ per CPU interface statistics structure to print

Returns:

Status code

te_errno tapi_cfg_stats_net_stats_get(const char* ta, tapi_cfg_net_stats* stats)

Get /proc/net/snmp like statistics for the host, where Test Agent is running.

Parameters:

ta

Test Agent to gather statistics on

stats

Resulted host statistics structure

Returns:

Status code

te_errno tapi_cfg_stats_net_stats_print(const char* ta, tapi_cfg_net_stats* stats)

Print /proc/net/snmp like statistics for the host, where Test Agent is running.

Parameters:

ta

Test Agent to gether statistics on

stats

Gathered host statistics structure to print

Returns:

Status code

te_errno tapi_cfg_stats_net_stats_print_diff(const tapi_cfg_net_stats* stats, const tapi_cfg_net_stats* prev, const char* descr_fmt, ...)

Print /proc/net/snmp like statistics difference with provided description.

Parameters:

stats

Network statistics.

prev

Previous network statistics or NULL.

descr_fmt

Description format string with arguments.

Returns:

Status code.