summaryrefslogtreecommitdiffstats
path: root/tango/stress-test.py
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-07-07 15:29:39 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-07-07 15:29:39 +0200
commite29ac7a7bcdeb14fffdebf8778ffcb1c3f06078c (patch)
tree2f4c2f889257e26950bb88c42a8a5d6b485e5a49 /tango/stress-test.py
parenta7a387042c38d1d9145fe8f52d5fd9c54349ce6d (diff)
downloadlibuca-e29ac7a7bcdeb14fffdebf8778ffcb1c3f06078c.tar.gz
libuca-e29ac7a7bcdeb14fffdebf8778ffcb1c3f06078c.tar.bz2
libuca-e29ac7a7bcdeb14fffdebf8778ffcb1c3f06078c.tar.xz
libuca-e29ac7a7bcdeb14fffdebf8778ffcb1c3f06078c.zip
TANGO: do not stop if encountering errors in test
Diffstat (limited to 'tango/stress-test.py')
-rw-r--r--tango/stress-test.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tango/stress-test.py b/tango/stress-test.py
index f2352bf..efbf68e 100644
--- a/tango/stress-test.py
+++ b/tango/stress-test.py
@@ -30,6 +30,7 @@ if __name__ == '__main__':
start = time.time()
size = 0
+ acquired = 0
if HAVE_PROGRESSBAR:
progress = progressbar.ProgressBar(max_value=args.number, redirect_stdout=True)
@@ -43,12 +44,11 @@ if __name__ == '__main__':
camera.Trigger()
frame = camera.image
+ size += frame.nbytes
+ acquired += 1
except:
- camera.Stop()
- print("Failure after {} frames".format(i))
- sys.exit(0)
+ pass
- size += frame.nbytes
if HAVE_PROGRESSBAR:
progress.update(i)
@@ -56,4 +56,5 @@ if __name__ == '__main__':
end = time.time()
camera.Stop()
+ print("Frames acquired: {}/{} ({:3.2f} %)".format(acquired, args.number, float(acquired) / args.number * 100))
print("Bandwidth: {:.3f} MB/s".format(size / (end - start) / 1024. / 1024.))