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 {
552
552
553
553
/// Download a crate into collector/benchmarks.
554
554
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
+ } ,
555
564
}
556
565
557
566
#[ derive( Debug , clap:: Parser ) ]
@@ -1057,6 +1066,14 @@ Make sure to modify `{dir}/perf-config.json` if the category/artifact don't matc
1057
1066
) ;
1058
1067
Ok ( 0 )
1059
1068
}
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
+ }
1060
1077
}
1061
1078
}
1062
1079
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.
3
4
4
5
## Remove data for a stable artifact from the DB
5
6
This 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.
8
9
9
10
The benchmark should be fixed first, and then the DB should be altered (see below).
10
11
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.
14
22
The set of queries below show an example of removing the measured data and errors for Rust ` 1.69 `
15
23
and ` 1.70 ` :
16
24
``` sql
You can’t perform that action at this time.
0 commit comments