id integer PRIMARY KEY,
dataset_id integer NOT NULL,
testset_id integer NOT NULL,
- date timestamp NOT NULL)''')
+ date timestamp DEFAULT CURRENT_TIMESTAMP,
+ target text NOT NULL)''')
+ conn.commit()
+ c.execute(
+ '''CREATE TABLE 'performance'(
+ id integer PRIMARY KEY,
+ benchmark_id integer NOT NULL,
+ data text)''')
conn.commit()
conn.close()
for row in ret:
print(row)
conn.close()
+
+
+def insert_benchmark(dataset_id, testset_id, target):
+ if not exist():
+ create()
+ conn = sqlite3.connect(DB_PATH)
+ c = conn.cursor()
+ benchmark_data = (dataset_id, testset_id, target)
+ c.execute(
+ 'INSERT INTO benchmark(dataset_id, testset_id, target) VALUES (?,?,?)', benchmark_data)
+ id = c.lastrowid
+ conn.commit()
+ conn.close()
+ return id
+
+
+def insert_performance(bench_id, text):
+ if not exist():
+ create()
+ conn = sqlite3.connect(DB_PATH)
+ c = conn.cursor()
+ c.execute(
+ 'INSERT INTO performance VALUES (null,?,?)', (bench_id, text))
+ conn.commit()
+ conn.close()
--- /dev/null
+import os
+from . import db
+import subprocess
+
+
+def run_bench(dataset_id, testset_id):
+ # check sdb
+ num_target = subprocess.check_output(
+ 'sdb devices | grep -v "List" | wc -l', shell=True)
+ assert(int(num_target) == 1)
+ target_type = subprocess.check_output(
+ 'sdb devices | tail -1 | cut -f 3', shell=True)
+ # check dataset is fit with testset
+ # check dataset is ready
+ bench_id = db.insert_benchmark(dataset_id, testset_id, target_type)
+ # insert result
+ for _ in range(5):
+ db.insert_performance(bench_id, "Pass, 1.5MB, 10s, ...")
import mvqa
import sys
-
if __name__ == "__main__":
if sys.version_info < (3, 0):
print('use python3')
if args.command == 'show':
mvqa.show_all()
elif args.command == 'run':
- print('run')
+ mvqa.run_bench(args.dataset, args.testset)
else:
parser.print_help()