summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-01-17 15:26:18 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-01-17 15:28:15 +0800
commit34674578cdbdae2a753b1cccf88959d414a676e7 (patch)
tree812c78cc0363167ced228cb31b7bb8a5f0a6a5f7
parent2378f04c1b6d333c322f93e44387c6f224dffe3e (diff)
Dump profiling data to json file to report by functest
Change-Id: Iceead5b8d47bea3c6dc9f0475dc453fb5062070a JIRA: DOCTOR-91 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rw-r--r--tests/profiler-poc.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/profiler-poc.py b/tests/profiler-poc.py
index 1b4379d4..71034781 100644
--- a/tests/profiler-poc.py
+++ b/tests/profiler-poc.py
@@ -18,8 +18,10 @@ Valid check points are: DOCTOR_PROFILER_T{00-09}
See also: https://goo.gl/98Osig
"""
+import json
import os
+LOGFILE = 'performance-profile'
PREFIX = 'DOCTOR_PROFILER'
TOTAL_CHECK_POINTS = 10
MODULE_CHECK_POINTS = ['T00', 'T01', 'T04', 'T05', 'T06', 'T09']
@@ -76,6 +78,9 @@ def main():
profile = TEMPLATE.format(**tags)
+ logfile = open('{}.json'.format(LOGFILE), 'w')
+ logfile.write(json.dumps(tags))
+
print profile
if __name__ == '__main__':