Stats improvement

This commit is contained in:
Atlante45 2015-08-03 17:39:09 -07:00
parent 99fcb08fd1
commit 40520c204f
3 changed files with 8 additions and 4 deletions

View file

@ -508,6 +508,8 @@ void Connection::processACK2(std::unique_ptr<ControlPacket> controlPacket) {
int rtt = duration_cast<microseconds>(now - it->second.second).count();
updateRTT(rtt);
// write this RTT to stats
_stats.recordRTT(rtt);
// set the RTT for congestion control
_congestionControl->setRTT(_rtt);

View file

@ -19,8 +19,8 @@
using namespace udt;
using namespace std::chrono;
static const int DEFAULT_PACKET_INTERVAL_MICROSECONDS = 1000000;
static const int DEFAULT_PROBE_INTERVAL_MICROSECONDS = 1000;
static const int DEFAULT_PACKET_INTERVAL_MICROSECONDS = 1000000; // 1s
static const int DEFAULT_PROBE_INTERVAL_MICROSECONDS = 1000; // 1ms
PacketTimeWindow::PacketTimeWindow(int numPacketIntervals, int numProbeIntervals) :
_numPacketIntervals(numPacketIntervals),

View file

@ -220,6 +220,7 @@ void UDTTest::sendPacket() {
void UDTTest::sampleStats() {
static bool first = true;
static const double USECS_PER_MSEC = 1000.0;
if (!_target.isNull()) {
if (first) {
@ -232,8 +233,6 @@ void UDTTest::sampleStats() {
int headerIndex = -1;
static const double USECS_PER_MSEC = 1000.0;
// setup a list of left justified values
QStringList values {
QString::number(stats.sendRate).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
@ -269,6 +268,9 @@ void UDTTest::sampleStats() {
// setup a list of left justified values
QStringList values {
QString::number(stats.receiveRate).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.estimatedBandwith).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.rtt / USECS_PER_MSEC).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.congestionWindowSize).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.recievedBytes).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.recievedUtilBytes).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(100 * (double)stats.recievedUtilBytes / (double)stats.recievedBytes).leftJustified(SERVER_STATS_TABLE_HEADERS[++headerIndex].size()),