diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-09-05 12:23:20 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-09-05 16:53:44 +0200 |
commit | 55eef24a55afb3708f2e02abf65b6934bed7f3de (patch) | |
tree | ef82d2bbc10a07058af957710e1ed7e1675d4f7a /bin | |
parent | 12f271ac519dfb018395b9680f082c183cd3dd14 (diff) |
crashreportScraper: Add ratio column
it makes sense to sort the sheet by this column
Change-Id: I05603dac80289605c18e86fbf27c3d899f9862c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156562
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/crashreportScraper.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/crashreportScraper.py b/bin/crashreportScraper.py index 54477f6c4c28..876570d3a028 100755 --- a/bin/crashreportScraper.py +++ b/bin/crashreportScraper.py @@ -28,9 +28,7 @@ def convert_str_to_date(value): value = value.replace('Sept', 'Sep') # reset the time leaving the date value = ", ".join(value.split(", ")[:-1]) - dtDate = datetime.strptime(value, '%b %d, %Y') - - return dtDate.strftime('%y/%m/%d') + return datetime.strptime(value, '%b %d, %Y') def parse_version_url(url): crashReports = {} @@ -201,7 +199,7 @@ if __name__ == '__main__': with open(fileName, "a") as f: if bInsertHeader: - line = '\t'.join(["Name", "Count", "First report", "Last Report", + line = '\t'.join(["Name", "Ratio", "Count", "First report", "Last Report", "ID", "Version", "Reason", "OS", "Stack", "Code Lines", "Last 4 UNO Commands", '\n']) f.write(line) f.flush() @@ -214,7 +212,8 @@ if __name__ == '__main__': "https://crashreport.libreoffice.org/stats/signature/" + urllib.parse.quote(k)) crashReason, crashStack, codeLine, unoCommands = parse_details_and_get_info( "https://crashreport.libreoffice.org/stats/crash_details/" + crashID, args.repository) - line = '\t'.join([k, str(crashCount), lDate[1], lDate[2], + ratio = round(crashCount / ((lDate[2] - lDate[1]).days + 1), 2) + line = '\t'.join([k, str(ratio), str(crashCount) , lDate[1].strftime('%y/%m/%d'), lDate[2].strftime('%y/%m/%d'), crashID, crashVersion, crashReason, crashOS, crashStack, codeLine, unoCommands, '\n']) f.write(line) f.flush() |