Skip to content

Commit

Permalink
fsperf: cleanup clean-results, add a test name option
Browse files Browse the repository at this point in the history
We import everything from ResultData, so ResultData.whatever breaks.
Additionally add an option to delete all the results for a particular
testname, this is helpful while testing new tests and we want to clean
up the results afterwards.

Signed-off-by: Josef Bacik <[email protected]>
  • Loading branch information
josefbacik committed Sep 29, 2022
1 parent 786c8b9 commit 20ff31c
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/clean-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
help="Labels to delete the results for")
parser.add_argument("--config", type=str,
help="Configs to delete the results for")
parser.add_argument("--test", type=str,
help="Test name to delete results for")
args = parser.parse_args()

if not args.labels and not args.config:
if not args.labels and not args.config and not args.test:
print("Must specify either labels or configs to delete from")
sys.exit(1)

Expand All @@ -25,24 +27,38 @@
outerjoin(FioResult).\
outerjoin(DbenchResult).\
outerjoin(TimeResult).\
outerjoin(ResultData.Fragmentation).\
outerjoin(ResultData.LatencyTrace).\
outerjoin(ResultData.BtrfsCommitStats).\
outerjoin(ResultData.MountTiming).\
outerjoin(Fragmentation).\
outerjoin(LatencyTrace).\
outerjoin(BtrfsCommitStats).\
outerjoin(MountTiming).\
filter(Run.purpose == p).all()
for r in results:
session.delete(r)
session.commit()

if args.test is not None:
results = session.query(Run).\
outerjoin(FioResult).\
outerjoin(DbenchResult).\
outerjoin(TimeResult).\
outerjoin(Fragmentation).\
outerjoin(LatencyTrace).\
outerjoin(BtrfsCommitStats).\
outerjoin(MountTiming).\
filter(Run.name == args.test).all()
for r in results:
session.delete(r)
session.commit()

if args.config is not None:
results = session.query(Run).\
outerjoin(FioResult).\
outerjoin(DbenchResult).\
outerjoin(TimeResult).\
outerjoin(ResultData.Fragmentation).\
outerjoin(ResultData.LatencyTrace).\
outerjoin(ResultData.BtrfsCommitStats).\
outerjoin(ResultData.MountTiming).\
outerjoin(Fragmentation).\
outerjoin(LatencyTrace).\
outerjoin(BtrfsCommitStats).\
outerjoin(MountTiming).\
filter(Run.config == args.config).all()
for r in results:
session.delete(r)
Expand Down

0 comments on commit 20ff31c

Please sign in to comment.