Class UDPStats
Defined in File UDPStats.h
Class Documentation
-
class UDPStats
Accumulate statistics for UDP based sockets. Provides information on data capture rates, data loss rates, interface errors.
Public Functions
-
void configure(unsigned packet_size, unsigned packet_data_size)
Configure the object based on UDP packet_size and packet_data_size.
The packet_size and packet_data_size should come from a UDPFormat but this would make a circular dependency on the UDPStat and UDPFormat. As such this method takes values of packet_size and packet_data_size
- Parameters
packet_size – total size of UDP data block
packet_data_size – size of data samples in data block
-
void increment(uint64_t num_packets = 1)
Increment bytes_transmitted by the specified number of packets.
- Parameters
num_packets – The number of packets to increment by.
-
void increment_bytes(uint64_t nbytes)
Increment bytes_transmitted by the specified number of bytes.
- Parameters
nbytes – Number of bytes to increment by.
-
void dropped(uint64_t num_packets = 1)
Increment bytes_dropped by the specified number of packets.
- Parameters
num_packets – The number of packets that were dropped.
-
void dropped_bytes(uint64_t nbytes)
Increment bytes_dropped by the specified amount.
- Parameters
nbytes – Number of bytes to increment bytes_dropped.
-
void ignored(uint64_t num_packets = 1)
Increment the number of valid packets that were ignored due to PSN/timestamps.
- Parameters
num_packets – The number of valid packets that were ignored
-
void sleeps(uint64_t num_sleeps = 1)
Increment the number of busy-wait sleeps by the specified amount.
- Parameters
num_sleeps – Number of busy-wait sleeps
-
void malformed(uint64_t num_packets = 1)
Increment the number of malformed packets.
- Parameters
num_packets –
-
void misordered(uint64_t num_packets = 1)
Increment the number of misordered packets.
- Parameters
num_packets –
-
void misdirected(uint64_t num_packets = 1)
Increment the number of misdirected packets.
- Parameters
num_packets –
-
void discarded(uint64_t num_packets = 1)
Increment the number of discarded packets.
- Parameters
num_packets –
-
void no_valid_polarisation_correction(uint64_t num_packets = 1)
Increment the number of packets received where no valid Jones polarisation corrections have been applied.
- Parameters
num_packets –
-
void no_valid_station_beam(uint64_t num_packets = 1)
Increment the number of packets received where no valid station beam delay polynomials have been applied.
- Parameters
num_packets –
-
void no_valid_pst_beam(uint64_t num_packets = 1)
Increment the number of packets received where no valid PST beam delay polynomials have been applied.
- Parameters
num_packets –
-
void reset()
Reset the internal counters.
-
inline uint64_t get_data_transmitted() const
Return the amount of data of data transmitted.
- Returns
uint64_t Number of bytes transmitted.
-
uint64_t get_packets_transmitted() const
Return the number of packets transmitted.
- Returns
uint64_t Number of packets transmitted
-
inline uint64_t get_data_dropped() const
Return the number of bytes dropped.
- Returns
uint64_t Number of bytes dropped.
-
uint64_t get_packets_dropped() const
Return the number of packets dropped.
- Returns
uint64_t Number of packets dropped.
-
inline uint64_t get_discarded() const
Get the number of discarded packets.
- Returns
uint64_t Number of discarded packets
-
inline uint64_t get_nsleeps() const
Return the number of busy-wait sleeps.
- Returns
uint64_t Number of busy-wait sleeps.
-
inline uint64_t get_ignored() const
Return the number of valid packets that were ignored.
- Returns
uint64_t Number of ignored packets
-
inline uint64_t get_malformed() const
Return the number of malformed packets.
- Returns
uint64_t Number of malformed packets
-
inline uint64_t get_misdirected() const
Get the number of misdirected packets.
- Returns
uint64_t Number of misdirected packets
-
inline uint64_t get_misordered() const
Get the number of misordered packets.
- Returns
uint64_t Number of misordered packets
-
inline uint64_t get_no_valid_polarisation_correction() const
Get the number of packets received where no valid Jones polarisation corrections have been applied.
- Returns
uint64_t the number of packets received where no valid Jones polarisation corrections have been applied
-
inline uint64_t get_no_valid_station_beam() const
Get the number of packets received where no valid station beam delay polynomials have been applied.
- Returns
uint64_t the number of packets received where no valid station beam delay polynomials have been applied
-
inline uint64_t get_no_valid_pst_beam() const
Get the number of packets received where no valid PST beam delay polynomials have been applied.
- Returns
uint64_t the number of packets received where no valid PST beam delay polynomials have been applied
-
void compute_rates()
Compute the instantaneous data rates.
-
double get_data_transmission_rate() const
Get the data transmission rate.
- Returns
float data transmission rate in bytes per second.
-
double get_data_drop_rate() const
Get the data drop rate.
- Returns
float data drop rate in bytes per second.
-
double get_sleep_rate() const
Get the number of busy-wait sleeps per second.
- Returns
double busy wait sleeps per second.
-
double get_no_valid_polarisation_correction_rate() const
Get the number of packets received where no valid Jones polarisation corrections have been applied per second.
- Returns
double the number of packets received where no valid Jones polarisation corrections have been applied per second
-
double get_no_valid_station_beam_rate() const
Get the number of packets received where no valid station beam delay polynomials have been applied per second.
- Returns
double the number of packets received where no valid station beam delay polynomials have been applied per second
-
double get_no_valid_pst_beam_rate() const
Get the number of packets received where no valid PST beam delay polynomials have been applied per second.
- Returns
double the number of packets received where no valid PST beam delay polynomials have been applied per second
-
void packet_receive_timeout()
Increment the number of packet timeout.
-
uint64_t get_packet_receive_timeouts() const
Get the packet receive timeouts.
- Returns
uint64_t returns packet_receive_timeouts
-
void set_packet_timeout_threshold(uint64_t threshold)
Set the packet timeout threshold.
- Parameters
threshold – timeout threshold between packets
-
void set_initial_packet_timeout_threshold(uint64_t threshold)
Set the initial packet timeout threshold.
- Parameters
threshold – Timeout threshold when waiting for the first packet
-
uint64_t get_packet_timeout_threshold()
Get the packet timeout threshold.
- Returns
uint64_t returns packet_timeout_threshold. Default value of 1
-
uint64_t get_initial_packet_timeout_threshold()
Get the initial packet timeout threshold.
- Returns
uint64_t returns initial_packet_timeout_threshold. Default value of 10
-
void configure(unsigned packet_size, unsigned packet_data_size)