Skip to content
Snippets Groups Projects
Commit 3043718e authored by Florian Pose's avatar Florian Pose
Browse files

Improved frame statistics output again.

parent b92fc4fe
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,12 @@ void CommandMaster::execute(const StringVector &args) ...@@ -112,6 +112,12 @@ void CommandMaster::execute(const StringVector &args)
&& data.devices[i].address[5] == 0x00) { && data.devices[i].address[5] == 0x00) {
cout << "None."; cout << "None.";
} else { } else {
unsigned int lost =
data.devices[i].tx_count - data.devices[i].rx_count;
if (lost == 1) {
// allow one frame travelling
lost = 0;
}
cout << hex << setfill('0') cout << hex << setfill('0')
<< setw(2) << (unsigned int) data.devices[i].address[0] << setw(2) << (unsigned int) data.devices[i].address[0]
<< ":" << ":"
...@@ -129,10 +135,15 @@ void CommandMaster::execute(const StringVector &args) ...@@ -129,10 +135,15 @@ void CommandMaster::execute(const StringVector &args)
<< ")" << endl << dec << ")" << endl << dec
<< " Link: " << " Link: "
<< (data.devices[i].link_state ? "UP" : "DOWN") << endl << (data.devices[i].link_state ? "UP" : "DOWN") << endl
<< " Tx count: " << data.devices[i].tx_count << endl << " Tx frames: "
<< " Rx count: " << data.devices[i].rx_count << endl << data.devices[i].tx_count << endl
<< " Tx bytes: " << data.devices[i].tx_bytes << endl << " Rx frames: "
<< " Tx errors: " << data.devices[i].tx_errors << endl << data.devices[i].rx_count << endl
<< " Lost frames: " << lost << endl
<< " Tx bytes: "
<< data.devices[i].tx_bytes << endl
<< " Tx errors: "
<< data.devices[i].tx_errors << endl
<< " Tx frame rate [1/s]: " << " Tx frame rate [1/s]: "
<< setfill(' ') << setprecision(0) << fixed; << setfill(' ') << setprecision(0) << fixed;
for (j = 0; j < EC_RATE_COUNT; j++) { for (j = 0; j < EC_RATE_COUNT; j++) {
...@@ -144,10 +155,10 @@ void CommandMaster::execute(const StringVector &args) ...@@ -144,10 +155,10 @@ void CommandMaster::execute(const StringVector &args)
} }
cout << endl cout << endl
<< " Tx rate [KByte/s]: " << " Tx rate [KByte/s]: "
<< setprecision(0) << fixed; << setprecision(1) << fixed;
for (j = 0; j < EC_RATE_COUNT; j++) { for (j = 0; j < EC_RATE_COUNT; j++) {
cout << cout << setw(5)
setw(5) << data.devices[i].tx_byte_rates[j] / 1000.0; << data.devices[i].tx_byte_rates[j] / 1024000.0;
if (j < EC_RATE_COUNT - 1) { if (j < EC_RATE_COUNT - 1) {
cout << " "; cout << " ";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment