Skip to content

Commit

Permalink
Include entry point in HTML metric report
Browse files Browse the repository at this point in the history
  • Loading branch information
florianschanda committed Nov 18, 2020
1 parent 1c676f8 commit 4d3fdf6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions miss_hit_core/mh_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,24 +567,28 @@ def write_text_report(fd,


def write_html_report(fd,
entry_point,
portable_html,
all_metrics,
ticket_summary,
worst_offenders):
base_url = PORTABLE_RES_URL if portable_html else RES_URL

if entry_point:
report_title = "MISS_HIT Report for %s" % entry_point
else:
report_title = "MISS_HIT Report"

fd.write("<!DOCTYPE html>\n")
fd.write("<html>\n")
fd.write("<head>\n")
fd.write("<meta charset=\"UTF-8\">\n")
# Link style-sheet with a relative path based on where the
# output report file will be
fd.write("<link rel=\"stylesheet\" href=\"%s/style.css\">\n" %
base_url)
fd.write("<title>MISS_HIT Report</title>\n")
fd.write("<title>%s</title>\n" % report_title)
fd.write("</head>\n")
fd.write("<body>\n")
fd.write("<header>MISS_HIT Report</header>\n")
fd.write("<header>%s</header>\n" % report_title)
fd.write("<main>\n")
fd.write("<div></div>\n")

Expand Down Expand Up @@ -1072,6 +1076,7 @@ def post_process(self):
elif self.options.html:
with open(self.options.html, "w") as fd:
write_html_report(fd,
self.options.entry_point,
self.options.portable_html,
self.metrics,
ticket_summary,
Expand Down

0 comments on commit 4d3fdf6

Please sign in to comment.