Permalink
Browse files

Export crashes list as CSV. This will allow the use of powerful BI to…

…ols like Pentaho to quickly analyze trends, spot which bugs need to be fixed in priority, and sometimes help solve crashes, for instance memory or OS problems. Not tested yet.
  • Loading branch information...
nicolas-raoul committed Jan 14, 2011
1 parent ce2bb08 commit 0d64df1ab3304b3bc744455a5792a4449b74988f
Showing with 24 additions and 0 deletions.
  1. +21 −0 report_ankicrashes.py
  2. +3 −0 templates/crash_list.csv
View
@@ -119,6 +119,27 @@ def get(self):
+class ExportCrashes(webapp.RequestHandler):
+ def get(self):
+ crashes_query = CrashReport.all()
+ bugId = self.request.get('bug_id')
+ page = int(self.request.get('page', 0))
+
+ crashes = []
+ if bugId:
+ bug = Bug.get_by_id(long(bugId))
+ crashes_query.filter("bugKey =", bug)
+ crashes_query.order("-crashTime")
+ total_results = crashes_query.count(1000000)
+
+ crashes = crashes_query.fetch(total_results, 0)
+ template_values = {'crashes_list': crashes,
+ 'total_results': total_results,
+ 'bug_id': bugId}
+ path = os.path.join(os.path.dirname(__file__), 'templates/crash_list.csv')
+ self.response.out.write(template.render(path, template_values))
+
+
class ReportCrashes(webapp.RequestHandler):
def get(self):
hospital_query = HospitalizedReport.all()
View
@@ -0,0 +1,3 @@
+Crash id;Crash Title;Crash Time;Version;Android;Brand;Model;Product;Device;Available Memory;Bug id;Occurrences of bug
+{% for cr in crashes_list %};{{ cr.crashId }};{{ cr.key.id }};{{ cr.crashTime|date:"Y-m-d H:i:s T" }};{{ cr.versionName }};{{ cr.androidOSVersion }};{{ cr.brand }};{{ cr.model }};{{ cr.product }};{{ cr.device }};{{ cr.availableInternalMemory }};{{ cr.bugKey.key.id }};{{ cr.bugKey.count }}
+{% endfor %}

0 comments on commit 0d64df1

Please sign in to comment.