Commit 0e5d3f39 authored by Simon Cruanes's avatar Simon Cruanes

nouveau script dans comparison pour recueillir des stats sur les prouveurs

parent 67ad9f88
......@@ -26,7 +26,7 @@ def diff(cursor, prover1, prover2):
def print_columns(lines):
def print_columns(lines, sep = "."):
"affiche les colonnes bien alignées"
if len(lines) == 0:
return
......@@ -35,10 +35,15 @@ def print_columns(lines):
for line in lines:
for i in xrange(column_width-1):
widths[i] = max(widths[i], len(str(line[i])))
widths[i] = max(widths[i], len(unicode(line[i])))
for line in lines:
for i in xrange(column_width-1):
assert(len(str(line[i])) <= widths[i])
print str(line[i]).ljust(widths[i]+2, "."),
assert(len(unicode(line[i])) <= widths[i])
print unicode(line[i]).ljust(widths[i]+2, sep),
print line[-1]
def print_sep():
"affiche une ligne de '-' pour séparer clairement des sections de l'affichage"
print "---------------------------------------------------------------"
#!/usr/bin/env python
#-*- coding: UTF-8 -*-
# ce script collecte des statistiques sur les prouveurs
import sys
import lib
# connexion DB
import sqlite3
conn = sqlite3.connect("output.db")
cursor = conn.cursor()
# trouver les prouveurs
provers = cursor.execute("select distinct prover from runs").fetchall()
provers = [line[0] for line in provers]
print "prouveurs trouvés :", ", ".join(provers)
lib.print_sep()
print ""
# collecter les statistiques (succès, échecs) de chaque prouveur
stats = {}
for prover in provers:
successes = cursor.execute("""
SELECT DISTINCT file,goal FROM runs
WHERE result = "Valid"
AND prover = "%s"
""" % prover).fetchall()
failures = cursor.execute("""
SELECT DISTINCT file,goal FROM runs
WHERE result = "Timeout"
AND prover = "%s"
""" % prover).fetchall()
stats[prover] = (len(successes), len(failures))
# mettre en forme
table = [["prouveur", u"nombre de succès", u"nombre d'échecs", "nombre total"]]
for prover in provers:
entry = [prover, stats[prover][0], stats[prover][1], stats[prover][0] + stats[prover][1]]
table.append(entry)
lib.print_columns(table, sep = " ")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment