Commit 9e60c56
committed
imporve qos log readability (sonic-net#12526)
Log message wrapper:
All the messages were outputted to PTF logging by default, and can set flag to output to stderr of PTF console for specific message.
so it can avoid lots of message flush on console and "test summary", easy to identify failure when triage.
and also can check PTF logging which include all the message when rootcause failure.
CounterCollector Class
provide general interface for counter collecting, comparing, and displaying.
Diagnostic Counter Wrapper
so far, we can read 8 kinds of counter:
port_counter, queue_counter_counter, queue_share_wm_counter, pg_share_wm_counter, pg_headroom_wm_counter, pg_counter_couner, pg_drop_counter and ptf_tx_rx_counter
Although CounterCollector provides a common API to collect, compare and display these counters, if you use countercollect directly, the code of the test case will still become confusing. After all, at least one line of code for each counter.
If the types of counter queries are subsequently increased, more code unrelated to the test steps will be exposed in the testcase.
Therefore, the diag coutner wrapper is used to include all types of counter activities, so that the code in the test case is more inclined to reflect the test steps and logic rather than these diagnostic codes.
assert wrapper
By default, we will display the counter difference between the first and last step of this case on both normal and abnormal exits.
but using python build-in assert instruction make it difficult to show counter diff.
so we implement a assert wrapper to show counter diff when assert exception occur.
TextTable Class
This is not newly added class, in befor, it help to output counters in table format like well-known python library prettytable.
in this PR, add a new class static method "merge_table())" to merge two table which need to show their difference.
example case:
not applied this feature to all qos testcase.
only applied above changes to xoff, xon, lossyqueue cases as a example first. Monitor for long time to collect the feedback, and then enhance.
already cover various sku/topo
see below test record table
skip chassis device
since test have not covered chassis yet, skip chassis device support so far.
How did you verify/test it?
pass verification in lab testbed1 parent 3e924dd commit 9e60c56
3 files changed
Lines changed: 432 additions & 183 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
| |||
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
| 638 | + | |
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
| |||
1162 | 1164 | | |
1163 | 1165 | | |
1164 | 1166 | | |
| 1167 | + | |
1165 | 1168 | | |
1166 | 1169 | | |
1167 | 1170 | | |
| |||
0 commit comments