[Libreoffice-commits] core.git: bin/compare-crashreport-stats.py

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 24 11:31:11 UTC 2021


 bin/compare-crashreport-stats.py |   62 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

New commits:
commit 397290489354d8ba5958d43acc58482c8115f69f
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Sep 24 10:09:10 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Sep 24 13:30:35 2021 +0200

    bin: Add script to compare the crashreport stats of two different versions
    
    Change-Id: I10103bf6a551f5dd5262ead9c6b34c8424d5430e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122563
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/bin/compare-crashreport-stats.py b/bin/compare-crashreport-stats.py
new file mode 100755
index 000000000000..26db30c24885
--- /dev/null
+++ b/bin/compare-crashreport-stats.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python3
+
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Use this script to compare the crashreport stats of two different versions of LibreOffice.
+# Usage sample: ./compare-crashreport-stats.py --old 7.2.0.4 --new 7.2.1.2
+
+import requests
+from bs4 import BeautifulSoup
+import argparse
+import sys
+
+def parse_url(url):
+    crashReports = {}
+    html_text = requests.get(url).text
+    soup = BeautifulSoup(html_text, 'html.parser')
+
+    table = soup.find("table", {"id": "data-table"}).tbody
+    for tr in table.find_all("tr"):
+        td_list = tr.find_all("td")
+        crashName = td_list[0].a.text.strip()
+        crashNumber = int(td_list[1].text.strip())
+        crashReports[crashName] = crashNumber
+
+    return crashReports
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument('--old', action='store', dest="old", required=True)
+    parser.add_argument('--new', action="store", dest="new", required=True)
+
+    results = parser.parse_args()
+
+    oldVersion = parse_url(
+            "https://crashreport.libreoffice.org/stats/version/" + results.old + "?limit=1000&days=30")
+    newVersion = parse_url(
+            "https://crashreport.libreoffice.org/stats/version/" + results.new + "?limit=1000&days=30")
+
+    print(str(len(oldVersion)) + " crash reports in version " + results.old)
+    print(str(len(newVersion)) + " crash reports in version " + results.new)
+    print()
+
+    print("===== Fixed Reports =====")
+    fixedReports = set(oldVersion.keys()) - set(newVersion.keys())
+    for k, v in sorted(oldVersion.items(), key=lambda item: item[1], reverse=True):
+        # Ignore rare reports
+        if v >= 20 and k in fixedReports:
+            print(str(v) + " " + k)
+
+    print()
+    print("===== Newly introduced Reports =====")
+    newReports = set(newVersion.keys()) - set(oldVersion.keys())
+    for k, v in sorted(newVersion.items(), key=lambda item: item[1], reverse=True):
+        # Ignore rare reports
+        if v >= 20 and k in newReports:
+            print(str(v) + " " + k)
+    print()


More information about the Libreoffice-commits mailing list