Skip to content

Commit

Permalink
Added Summary view to sqlite db
Browse files Browse the repository at this point in the history
View can be used for post reporting results summary, unfortunately  because the percentile was implemented as a python class it could not be included in this view.
  • Loading branch information
damies13 committed Nov 21, 2019
1 parent 53089e0 commit f64cb83
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions rfswarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,39 @@ def ensure_db(self):
# create indexes?

# create views?

# CREATE VIEW "summary" AS SELECT
# r.result_name,
# min(rp.elapsed_time) "min", avg(rp.elapsed_time) "avg", max(rp.elapsed_time) "max",
# count(rp.result) as _pass,
# count(rf.result) as _fail,
# count(ro.result) as _other
#
# FROM Results as r
# LEFT JOIN Results as rp ON r.rowid == rp.rowid AND rp.result == "PASS"
# LEFT JOIN Results as rf ON r.rowid == rf.rowid AND rf.result == "FAIL"
# LEFT JOIN Results as ro ON r.rowid == ro.rowid AND ro.result <> "PASS" AND ro.result <> "FAIL"
# GROUP BY
# r.result_name
# ORDER BY r.sequence
c.execute('''
CREATE VIEW "Summary" AS SELECT
r.result_name,
min(rp.elapsed_time) "min", avg(rp.elapsed_time) "avg", max(rp.elapsed_time) "max",
count(rp.result) as _pass,
count(rf.result) as _fail,
count(ro.result) as _other
FROM Results as r
LEFT JOIN Results as rp ON r.rowid == rp.rowid AND rp.result == "PASS"
LEFT JOIN Results as rf ON r.rowid == rf.rowid AND rf.result == "FAIL"
LEFT JOIN Results as ro ON r.rowid == ro.rowid AND ro.result <> "PASS" AND ro.result <> "FAIL"
GROUP BY
r.result_name
ORDER BY r.sequence
''')


self.datadb.commit()

def delayed_UpdateAgents(self):
Expand Down

0 comments on commit f64cb83

Please sign in to comment.