summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2016-08-18 11:05:30 -0400
committerJohn Kacur <jkacur@redhat.com>2016-08-18 16:42:35 +0100
commit7818ecdae095722a6b5aed3a309bb9f5e71bf508 (patch)
tree3136555b1e3cd22cf6db562b1d13fc624eabe0e2
parentf2503b53fe4c520946fcc121c9fa11e02d071d10 (diff)
downloadrt-tests-7818ecdae095722a6b5aed3a309bb9f5e71bf508.tar.gz
rt-tests: hwlatdetect: Improve message if max latency is below threshold
Improve message if max latency is below threshold. If the maximum latency is below the threshold for reporting, 0us is output. This is confusing, and not accurate, so print the message "Below threshold" instead. Suggested-by: Jiri Kastner <jkastner@redhat.com> Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-xsrc/hwlatdetect/hwlatdetect.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
index d9ef027..4a01434 100755
--- a/src/hwlatdetect/hwlatdetect.py
+++ b/src/hwlatdetect/hwlatdetect.py
@@ -568,9 +568,15 @@ if __name__ == '__main__':
info("test finished")
- exceeding = detect.get("count")
- info("Max Latency: %dus" % detect.get("max"))
+ max_latency = detect.get("max")
+ if max_latency == 0:
+ info("Max Latency: Below threshold")
+ else:
+ info("Max Latency: %dus" % max_latency)
+
info("Samples recorded: %d" % len(detect.samples))
+
+ exceeding = detect.get("count")
info("Samples exceeding threshold: %d" % exceeding)
if detect.have_msr: