File tree Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -552,6 +552,15 @@ enum Commands {
552552
553553 /// Download a crate into collector/benchmarks.
554554 Download ( DownloadCommand ) ,
555+
556+ /// Removes all data associated with artifact(s) with the given name.
557+ PurgeArtifact {
558+ /// Name of the artifact.
559+ name : String ,
560+
561+ #[ command( flatten) ]
562+ db : DbOption ,
563+ } ,
555564}
556565
557566#[ derive( Debug , clap:: Parser ) ]
@@ -1057,6 +1066,14 @@ Make sure to modify `{dir}/perf-config.json` if the category/artifact don't matc
10571066 ) ;
10581067 Ok ( 0 )
10591068 }
1069+ Commands :: PurgeArtifact { name, db } => {
1070+ let pool = Pool :: open ( & db. db ) ;
1071+ let conn = rt. block_on ( pool. connection ( ) ) ;
1072+ rt. block_on ( conn. purge_artifact ( & ArtifactId :: Tag ( name. clone ( ) ) ) ) ;
1073+
1074+ println ! ( "Data of artifact {name} were removed" ) ;
1075+ Ok ( 0 )
1076+ }
10601077 }
10611078}
10621079
Original file line number Diff line number Diff line change 1- # Useful queries
2- This document contains useful queries that should be performed manually in exceptional situations.
1+ # Useful queries and commands
2+ This document contains useful queries and commands that should be performed manually in exceptional
3+ situations.
34
45## Remove data for a stable artifact from the DB
56This is important for situations where there is some compilation error for a stable benchmark,
@@ -8,9 +9,16 @@ of future incompatibility lints turning into errors.
89
910The benchmark should be fixed first, and then the DB should be altered (see below).
1011
11- The easiest solution is to simply completely remove the artifact from the DB. There are
12- ` ON DELETE CASCADE ` clauses for ` aid ` (artifact ID) on tables that reference it, so it should be
13- enough to just delete the artifact from the ` artifact ` table.
12+ The easiest solution is to simply completely remove the artifact from the DB.
13+ You can do that either using the following command:
14+
15+ ``` bash
16+ $ cargo run --bin collector purge_artifact < artifact-name>
17+ # $ cargo run --bin collector purge_artifact 1.70.0 # Remove stable artifact 1.70.0
18+ ```
19+
20+ Or using SQL queries. There are ` ON DELETE CASCADE ` clauses for ` aid ` (artifact ID) on tables that
21+ reference it, so it should be enough to just delete the artifact from the ` artifact ` table.
1422The set of queries below show an example of removing the measured data and errors for Rust ` 1.69 `
1523and ` 1.70 ` :
1624``` sql
You can’t perform that action at this time.
0 commit comments