Skip to content

Commit

Permalink
Merge pull request #6 from hammad45/master
Browse files Browse the repository at this point in the history
Added support for DXT issues and recommendations
  • Loading branch information
jeanbez authored Feb 1, 2023
2 parents 233fb16 + 6a412ef commit 55cc218
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions drishti/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import csv
import time
import json
import shlex
import datetime
import argparse
Expand Down Expand Up @@ -42,6 +43,7 @@

insights_operation = []
insights_metadata = []
insights_dxt = []

insights_total = dict()

Expand Down Expand Up @@ -179,6 +181,12 @@
help='Export a CSV with the code of all issues that were triggered'
)

parser.add_argument(
'--json',
default=False,
dest='json',
help=argparse.SUPPRESS)

args = parser.parse_args()

if args.export_size:
Expand Down Expand Up @@ -1437,6 +1445,29 @@ def main():
pass
except FileNotFoundError:
pass

#########################################################################################################################################################################

codes = []
if args.json:
f = open(args.json)
data = json.load(f)

for key, values in data.items():
for value in values:
code = value['code']
codes.append(code)

level = value['level']
issue = value['issue']
recommendation = []
for rec in value['recommendations']:
new_message = {'message': rec}
recommendation.append(new_message)

insights_dxt.append(
message(code, TARGET_DEVELOPER, level, issue, recommendation)
)

#########################################################################################################################################################################

Expand Down Expand Up @@ -1527,6 +1558,20 @@ def main():
)
)

if insights_dxt:
console.print(
Panel(
Padding(
Group(
*insights_dxt
),
(1, 1)
),
title='DXT',
title_align='left'
)
)

console.print(
Panel(
' {} | [white]LBNL[/white] | [white]Drishti report generated at {} in[/white] {:.3f} seconds'.format(
Expand Down Expand Up @@ -1617,6 +1662,8 @@ def main():
INSIGHTS_MPI_IO_AGGREGATORS_INTER,
INSIGHTS_MPI_IO_AGGREGATORS_OK
]
if codes:
issues.extend(codes)

detected_issues = dict.fromkeys(issues, False)
detected_issues['JOB'] = job['job']['jobid']
Expand Down

0 comments on commit 55cc218

Please sign in to comment.