Table of Contents

Name

thrulay_get_report - get a thrulay report.

Synopsis

#include <thrulay.h>

int thrulay_get_report(int tid, int sid, int index, void * rpt);

Description

thrulay_get_report gets the index-th (starting from 1) test report of a TCP or UDP stream in a particular test. tid specifies a test and sid specifies a stream in a test. If the test was registered as a TCP test, rpt should be a pointer to the thrulay_report_tcp_t structure:

typedef struct _thrulay_report_tcp {
    thrulay_report_type_t type; /* Intermediate/final report. */
    double begin; /* Start of this test report. */
    double end; /* End of this test report. */
    double bandwidth; /* Bandwidth in Mb/s. */
    double min_rtt; /* Minimum rtt in ms. */
    double avg_rtt; /* Average rtt in ms. */
    double max_rtt; /* Maximum rtt in ms. */
} thrulay_report_tcp_t;

If the test was registered as an UDP test, rpt should be a pointer to the thrulay_report_udp_t structure:

typedef struct _thrulay_report_udp {
    thrulay_report_type_t type; /* Intermediate/final report. */
    int udp_buffer_size; /* Size of server UDP buffer. */
    u_int64_t npackets; /* # of packets proposed to send. */
    u_int64_t packets_sent; /* # of packets actually sent. */
    u_int64_t packets_received; /* # of packets received. */
    u_int64_t packets_duplicate; /* # of duplicated packet.*/
    u_int64_t nloss_periods; /* # of loss periods. */
    u_int64_t nreorder[MAX_N]; /* x-reording of packets.*/
    double min_delay; /* 00th quantile of delays. */
    double median_delay; /* 50th quantile of delays. */
    double quantile95_delay; /* 95th quantile of delays. */
} thrulay_report_udp_t;

Return Values

Return 0 on success. Otherwise, an error code is returned.

Examples

Get the report of an UDP test stream.

int tid, rc;
thrulay_setting_udp_t setting_udp;
thrulay_report_udp_t report_udp;

thrulay_init();
setting_udp.server_name = "nmsa-aami.internet2.edu";
setting_udp.port = 5003;
setting_udp.test_duration = 5;
setting_udp.nstream = 3;
tid = thrulay_open(THRULAY_UDP, &setting_udp);
if (tid <= 0) {handle error};
if (tid != thrulay_wait(tid, &status, THRULAY_WAIT)) {handle error};
if (status > 0) {
    /* get report of the last stream. */
    rc = thrulay_get_report(tid, 2, &report_udp);
    if (rc == 0) {print udp report};
}                            

Bugs

Please send bug reports to <huadongliu@gmail.com>.

Author

Huadong Liu <huadongliu@gmail.com>

Homepage

http://thrulay-hd.sourceforge.net/

See Also

thrulay_get_setup(3)


Table of Contents