diff options
Diffstat (limited to 'tests/profiler-poc.py')
-rw-r--r-- | tests/profiler-poc.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/profiler-poc.py b/tests/profiler-poc.py index f20cad1c..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'] @@ -34,8 +36,8 @@ Total time cost: {total}(ms) host down:{T00}| | | | | | | | | raw failure:{T01}| | | | | | | | found affected:{T02}| | | | | | | - marked host down:{T03}| | | | | | - set VM error:{T04} | | | | | + set VM error:{T03}| | | | | | + marked host down:{T04}| | | | | notified VM error:{T05} | | | | transformed event:{T06}| | | evaluated event:{T07}| | @@ -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__': |