X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Fprofiler-poc.py;h=408cb09a878f2adae72843cb1bdf53a7af502459;hb=d5918a87f12fdef9bd7408c4554c42606c4896d8;hp=f20cad1c0e1cf7817d09146a2d5ebf29ee369b33;hpb=cf5a27a4bae9a087cd127aae8398a54ff69a5b73;p=doctor.git diff --git a/tests/profiler-poc.py b/tests/profiler-poc.py index f20cad1c..408cb09a 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 +OUTPUT = 'doctor_profiling_output' PREFIX = 'DOCTOR_PROFILER' TOTAL_CHECK_POINTS = 10 MODULE_CHECK_POINTS = ['T00', 'T01', 'T04', 'T05', 'T06', 'T09'] @@ -31,11 +33,11 @@ Total time cost: {total}(ms) |Monitor|Inspector |Controller|Notifier|Evaluator | |{M00} |{M01} |{M02} |{M03} |{M04} | | | | | | | | | | | -host down:{T00}| | | | | | | | | +link 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(OUTPUT), 'w') + logfile.write(json.dumps(tags)) + print profile if __name__ == '__main__':