mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
tos-test: Fix latency normalization logic, improve tos-test py
Seems to work OK now.
This commit is contained in:
@@ -129,7 +129,10 @@ sub normalize_bucket_hdr {
|
|||||||
my $i;
|
my $i;
|
||||||
for ($i = 0; $i<$amt; $i++) {
|
for ($i = 0; $i<$amt; $i++) {
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
$rv .= "0-0 ";
|
$rv .= "0 ";
|
||||||
|
}
|
||||||
|
elsif ($i == 1) {
|
||||||
|
$rv .= "1 ";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$rv .= 2**($i-1) . "-" . (2**($i) - 1) . " ";
|
$rv .= 2**($i-1) . "-" . (2**($i) - 1) . " ";
|
||||||
@@ -203,7 +206,7 @@ sub normalize_bucket {
|
|||||||
for ($i = 0; $i<@bkts; $i++) {
|
for ($i = 0; $i<@bkts; $i++) {
|
||||||
# Figure out the bkt range
|
# Figure out the bkt range
|
||||||
my $minv = 0;
|
my $minv = 0;
|
||||||
my $maxv = 2 ** $i;
|
my $maxv = 2 ** $i - 1;
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$minv = 2 ** ($i - 1);
|
$minv = 2 ** ($i - 1);
|
||||||
}
|
}
|
||||||
@@ -219,7 +222,7 @@ sub normalize_bucket {
|
|||||||
#print "maxv: $maxv\n";
|
#print "maxv: $maxv\n";
|
||||||
my $z;
|
my $z;
|
||||||
my $idx = 0;
|
my $idx = 0;
|
||||||
for ($z = 1; $z < 32; $z++) {
|
for ($z = 0; $z < 32; $z++) {
|
||||||
if ($maxv < (2 ** $z)) {
|
if ($maxv < (2 ** $z)) {
|
||||||
#print "maxv: $maxv z: $z 2^$z: " . 2 ** $z . + "\n";
|
#print "maxv: $maxv z: $z 2^$z: " . 2 ** $z . + "\n";
|
||||||
$idx = $z;
|
$idx = $z;
|
||||||
@@ -231,7 +234,7 @@ sub normalize_bucket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#print "idx: $idx i: $i ";
|
#print "idx: $idx i: $i minv: $minv maxv: $maxv min: $min adjust: $adjust\n";
|
||||||
#print "nbkts: " . $nbkts[$idx];
|
#print "nbkts: " . $nbkts[$idx];
|
||||||
#print " bkts: " . $bkts[$i] . "\n";
|
#print " bkts: " . $bkts[$i] . "\n";
|
||||||
my $nv = $nbkts[$idx] + $bkts[$i];
|
my $nv = $nbkts[$idx] + $bkts[$i];
|
||||||
|
|||||||
@@ -174,35 +174,52 @@ def main():
|
|||||||
|
|
||||||
worksheet.set_row(0, 45) # Set height
|
worksheet.set_row(0, 45) # Set height
|
||||||
|
|
||||||
bucket_hdrs = "0-0 1-1 2-3 4-7 8-15 16-31 32-63 64-127 128-255 256-511 512-1023 1024-2047 2048-4095 4096-8191 8192-16383 16384-32767 32768-65535".split()
|
bucket_hdrs = "0 1 2-3 4-7 8-15 16-31 32-63 64-127 128-255 256-511 512-1023 1024-2047 2048-4095 4096-8191 8192-16383 16384-32767 32768-65535".split()
|
||||||
col = 0
|
col = 0
|
||||||
row = 0
|
row = 0
|
||||||
|
|
||||||
worksheet.set_column(0, 35, 13) # Set width to 14 for all columns by default
|
dwidth = 13 # Set width to 13 for all columns by default
|
||||||
|
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'CX-Name', dblue_bold); col += 1
|
worksheet.write(row, col, 'CX-Name', dblue_bold); col += 1
|
||||||
worksheet.set_column(col, col, 15)
|
worksheet.set_column(col, col, 15)
|
||||||
worksheet.write(row, col, 'Endp-Name', dblue_bold); col += 1
|
worksheet.write(row, col, 'Endp-Name', dblue_bold); col += 1
|
||||||
worksheet.set_column(col, col, 12)
|
worksheet.set_column(col, col, 12)
|
||||||
worksheet.write(row, col, 'Port', dblue_bold); col += 1
|
worksheet.write(row, col, 'Port', dblue_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Protocol', dblue_bold); col += 1
|
worksheet.write(row, col, 'Protocol', dblue_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'ToS', dblue_bold); col += 1
|
worksheet.write(row, col, 'ToS', dblue_bold); col += 1
|
||||||
worksheet.set_column(col, col, 20)
|
worksheet.set_column(col, col, 20)
|
||||||
worksheet.write(row, col, 'AP BSSID', dblue_bold); col += 1
|
worksheet.write(row, col, 'AP BSSID', dblue_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Band\nwidth', dblue_bold); col += 1
|
worksheet.write(row, col, 'Band\nwidth', dblue_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Mode', dblue_bold); col += 1
|
worksheet.write(row, col, 'Mode', dblue_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Last MCS\nRx', dblue_bold); col += 1
|
worksheet.write(row, col, 'Last MCS\nRx', dblue_bold); col += 1
|
||||||
worksheet.write(row, col, 'Combined\nRSSI', dpeach_bold); col += 1
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Endpoint\nOffered\nLoad', dblue_bold); col += 1
|
worksheet.write(row, col, 'Combined\nRSSI', dblue_bold); col += 1
|
||||||
worksheet.write(row, col, 'Endpoint\nRx\nThroughput', dblue_bold); col += 1
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Cx\nOffered\nLoad', dblue_bold); col += 1
|
worksheet.write(row, col, 'Endpoint\nOffered\nLoad', dtan_bold); col += 1
|
||||||
worksheet.write(row, col, 'Cx\nRx\nThroughput', dblue_bold); col += 1
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Avg\nLatency', dblue_bold); col += 1
|
worksheet.write(row, col, 'Endpoint\nRx\nThroughput', dtan_bold); col += 1
|
||||||
worksheet.write(row, col, 'Min\nLatency', dblue_bold); col += 1
|
worksheet.set_column(col, col, dwidth)
|
||||||
worksheet.write(row, col, 'Max\nLatency', dblue_bold); col += 1
|
worksheet.write(row, col, 'Cx\nOffered\nLoad', dtan_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
|
worksheet.write(row, col, 'Cx\nRx\nThroughput', dtan_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
|
worksheet.write(row, col, 'Avg\nLatency', dyel_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
|
worksheet.write(row, col, 'Min\nLatency', dyel_bold); col += 1
|
||||||
|
worksheet.set_column(col, col, dwidth)
|
||||||
|
worksheet.write(row, col, 'Max\nLatency', dyel_bold); col += 1
|
||||||
for i in range(17):
|
for i in range(17):
|
||||||
btitle = "Latency\nRange\n%s"%(bucket_hdrs[i])
|
btitle = "Latency\nRange\n%s"%(bucket_hdrs[i])
|
||||||
worksheet.write(row, col, btitle, dblue_bold); col += 1
|
worksheet.set_column(col, col, dwidth)
|
||||||
|
worksheet.write(row, col, btitle, dpeach_bold); col += 1
|
||||||
|
|
||||||
|
worksheet.set_column(col, col, 50)
|
||||||
worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1
|
worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1
|
||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
@@ -366,9 +383,11 @@ def main():
|
|||||||
if (m != None):
|
if (m != None):
|
||||||
_signal = m.group(1)
|
_signal = m.group(1)
|
||||||
|
|
||||||
|
count = 0
|
||||||
for p in protos:
|
for p in protos:
|
||||||
for t in toss:
|
for t in toss:
|
||||||
cxn = cxnames[count]
|
cxn = cxnames[count]
|
||||||
|
count = count + 1
|
||||||
|
|
||||||
# Results: tx_bytes, rx_bytes, tx_bps, rx_bps, tx_pkts, rx_pkts, Latency
|
# Results: tx_bytes, rx_bytes, tx_bps, rx_bps, tx_pkts, rx_pkts, Latency
|
||||||
resultsA = ["0"] * 7
|
resultsA = ["0"] * 7
|
||||||
@@ -385,7 +404,7 @@ def main():
|
|||||||
pss = endp_stats.stdout.decode('utf-8', 'ignore');
|
pss = endp_stats.stdout.decode('utf-8', 'ignore');
|
||||||
|
|
||||||
for line in pss.splitlines():
|
for line in pss.splitlines():
|
||||||
print("probe-line, endp: %s: %s"%(ename, line))
|
#print("probe-line, endp: %s: %s"%(ename, line))
|
||||||
m = re.search('Rx Bytes:\s+(\d+)', line)
|
m = re.search('Rx Bytes:\s+(\d+)', line)
|
||||||
if (m != None):
|
if (m != None):
|
||||||
results[1] = int(m.group(1))
|
results[1] = int(m.group(1))
|
||||||
@@ -434,10 +453,10 @@ def main():
|
|||||||
"--lat1", resultsB[6], "--lat2", resultsA[6]], capture_output=True);
|
"--lat1", resultsB[6], "--lat2", resultsA[6]], capture_output=True);
|
||||||
pssB = endp_statsB.stdout.decode('utf-8', 'ignore');
|
pssB = endp_statsB.stdout.decode('utf-8', 'ignore');
|
||||||
|
|
||||||
print("latA: %s"%resultsA[6])
|
#print("%s: latA: %s"%(cxn, resultsA[6]))
|
||||||
print("latB: %s"%resultsB[6])
|
#print("%s: latB: %s"%(cxn, resultsB[6]))
|
||||||
print("pssA: %s"%pssA)
|
#print("%s: pssA: %s"%(cxn, pssA))
|
||||||
print("pssB: %s"%pssB)
|
#print("%s: pssB: %s"%(cxn, pssB))
|
||||||
|
|
||||||
for line in pssA.splitlines():
|
for line in pssA.splitlines():
|
||||||
m = re.search('Normalized-Latency:\s+(.*)', line)
|
m = re.search('Normalized-Latency:\s+(.*)', line)
|
||||||
@@ -465,8 +484,8 @@ def main():
|
|||||||
worksheet.write(row, col, "%s.%s"%(sta_resource, sta_name), center_blue); col += 1
|
worksheet.write(row, col, "%s.%s"%(sta_resource, sta_name), center_blue); col += 1
|
||||||
else:
|
else:
|
||||||
worksheet.write(row, col, "%s.%s"%(u_resource, u_name), center_blue); col += 1
|
worksheet.write(row, col, "%s.%s"%(u_resource, u_name), center_blue); col += 1
|
||||||
worksheet.write(row, col, proto, center_blue); col += 1
|
worksheet.write(row, col, p, center_blue); col += 1
|
||||||
worksheet.write(row, col, tos, center_blue); col += 1
|
worksheet.write(row, col, t, center_blue); col += 1
|
||||||
if ename == ena:
|
if ename == ena:
|
||||||
worksheet.write(row, col, _ap, center_blue); col += 1
|
worksheet.write(row, col, _ap, center_blue); col += 1
|
||||||
worksheet.write(row, col, _bw, center_blue); col += 1
|
worksheet.write(row, col, _bw, center_blue); col += 1
|
||||||
@@ -481,15 +500,15 @@ def main():
|
|||||||
worksheet.write(row, col, "", center_blue); col += 1
|
worksheet.write(row, col, "", center_blue); col += 1
|
||||||
worksheet.write(row, col, "", center_blue); col += 1
|
worksheet.write(row, col, "", center_blue); col += 1
|
||||||
|
|
||||||
print("results[2]:%s 3: %s"%(results[2], results[3]))
|
#print("results[2]:%s 3: %s"%(results[2], results[3]))
|
||||||
|
|
||||||
worksheet.write(row, col, "%.2f"%(float(results[2]) / 1000000), center_blue); col += 1
|
worksheet.write(row, col, "%.2f"%(float(results[2]) / 1000000), center_tan); col += 1
|
||||||
worksheet.write(row, col, "%.2f"%(float(results[3]) / 1000000), center_tan); col += 1
|
worksheet.write(row, col, "%.2f"%(float(results[3]) / 1000000), center_tan); col += 1
|
||||||
worksheet.write(row, col, "%.2f"%((float(resultsA[2]) + float(resultsB[2])) / 1000000), center_blue); col += 1
|
worksheet.write(row, col, "%.2f"%((float(resultsA[2]) + float(resultsB[2])) / 1000000), center_tan); col += 1
|
||||||
worksheet.write(row, col, "%.2f"%((float(resultsA[3]) + float(resultsB[3])) / 1000000), center_tan); col += 1
|
worksheet.write(row, col, "%.2f"%((float(resultsA[3]) + float(resultsB[3])) / 1000000), center_tan); col += 1
|
||||||
worksheet.write(row, col, lat_cols[2], center_tan); col += 1
|
worksheet.write(row, col, lat_cols[2], center_yel); col += 1
|
||||||
worksheet.write(row, col, lat_cols[0], center_tan); col += 1
|
worksheet.write(row, col, lat_cols[0], center_yel); col += 1
|
||||||
worksheet.write(row, col, lat_cols[1], center_tan); col += 1
|
worksheet.write(row, col, lat_cols[1], center_yel); col += 1
|
||||||
for x in range(17):
|
for x in range(17):
|
||||||
worksheet.write(row, col, lat_cols[x + 3], center_peach); col += 1
|
worksheet.write(row, col, lat_cols[x + 3], center_peach); col += 1
|
||||||
|
|
||||||
@@ -500,8 +519,12 @@ def main():
|
|||||||
row += 1
|
row += 1
|
||||||
|
|
||||||
# Stop traffic
|
# Stop traffic
|
||||||
subprocess.run(["./lf_firemod.pl", "--manager", lfmgr, "--resource",
|
for cxn in cxnames:
|
||||||
"--cmd", "set_cx_state all %s STOPPED"%cxn], capture_output=True);
|
cmd = "set_cx_state all %s STOPPED"%cxn
|
||||||
|
#print("Stopping CX: %s with command: %s"%(cxn, cmd));
|
||||||
|
|
||||||
|
subprocess.run(["./lf_firemod.pl", "--manager", lfmgr, "--action", "do_cmd",
|
||||||
|
"--cmd", cmd], capture_output=True);
|
||||||
|
|
||||||
|
|
||||||
workbook.close()
|
workbook.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user