You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is an explanation of the current database schema. This schema is duplicated across the (currently) two database backends we support: sqlite and postgres.
4
4
5
-
6
5
## Overview
7
6
8
7
In general, the database is used to track three groups of things:
9
-
* Performance run statistics (e.g., instruction count) on a per benchmark, profile, and cache-state basis.
8
+
* Performance run statistics (e.g., instruction count) for compile time benchmarks on a per benchmark, profile, and scenario basis.
9
+
* Performance run statistics (e.g., instruction count) for runtime benchmarks on a per benchmark basis.
10
10
* Self profile data gathered with `-Zself-profile`.
11
-
* State when running GitHub bots and the performance runs (e.g., how long it took for a performance suite to run, errors encountered a long the way, etc.)
11
+
* State when running GitHub bots and the performance runs (e.g., how long it took for a performance suite to run, errors encountered along the way, etc.)
12
12
13
13
Below are some diagrams showing the basic layout of the database schema for these three uses:
14
14
15
15
### Performance run statistics
16
16
17
+
Here is the diagram for compile-time benchmarks:
17
18
```
18
19
┌────────────┐ ┌───────────────┐ ┌────────────┐
19
20
│ benchmark │ │ collection │ │ artifact │
@@ -36,132 +37,252 @@ Below are some diagrams showing the basic layout of the database schema for thes
36
37
└───────────────┘ └──────────┘
37
38
```
38
39
39
-
### Self profile data
40
-
41
-
**TODO**
42
-
43
-
### Miscellaneous State
44
-
45
-
**TODO**
40
+
For runtime benchmarks the schema very similar, but there are different table names:
41
+
-`benchmark` => `runtime_benchmark`
42
+
-`pstat` => `runtime_pstat`
43
+
-`pstat_series` => `runtime_pstat_series`
44
+
- There are different attributes here, `benchmark` and `metric`.
46
45
47
46
## Tables
48
47
49
-
### benchmark
50
-
51
-
The different types of benchmarks that are run.
52
-
53
-
The table stores the name of the benchmark as well as whether it is capable of being run using the stable compiler. The benchmark name is used as a foreign key in many of the other tables.
54
-
55
-
```
56
-
sqlite> select * from benchmark limit 1;
57
-
name stabilized
58
-
---------- ----------
59
-
helloworld 0
60
-
```
61
-
62
48
### artifact
63
49
64
-
A description of a rustc compiler artifact being benchmarked.
50
+
A description of a rustc compiler artifact being benchmarked.
65
51
66
52
This description includes:
67
53
* name: usually a commit sha or a tag like "1.51.0" but is free-form text so can be anything.
68
-
* date: the date associated with this compiler artifact (usually only when the name is a commit)
54
+
* date: the date associated with this compiler artifact (usually only when the name is a commit)
69
55
* type: currently one of "master" (i.e., we're testing a merge commit), "try" (someone is testing a PR), and "release" (usually a release candidate - though local compilers also get labeled like this).
70
56
71
57
```
72
58
sqlite> select * from artifact limit 1;
73
-
id name date type
74
-
---------- ---------- ---------- ----------
75
-
1 LOCAL_TEST release
59
+
id name date type
60
+
---------- ---------- ---------- -------
61
+
1 LOCAL_TEST release
76
62
```
77
63
78
64
### collection
79
65
80
66
A "collection" of benchmarks tied only differing by the statistic collected.
81
67
82
-
This is a way to collect statistics together signifying that they belong to the same logical benchmark run.
68
+
This is a way to collect statistics together signifying that they belong to the same logical benchmark run.
83
69
84
-
Currently the collection also marks the git sha of the currently running collector binary.
70
+
Currently, the collection also marks the git sha of the currently running collector binary.
Keeps track of the collector's start and finish time as well as which step it's currently on.
82
+
83
+
```
84
+
sqlite> select * from collector_progress limit 1;
85
+
aid step start end
86
+
---------- ---------- ---------- ----------
87
+
1 helloworld 1625829961 1625829965
88
+
```
89
+
90
+
### artifact_collection_duration
91
+
92
+
Records how long benchmarking takes in seconds.
93
+
94
+
```
95
+
sqlite> select * from artifact_collection_duration limit 1;
96
+
aid date_recorded duration
97
+
---------- ------------- ----------
98
+
1 1625829965 4
99
+
```
100
+
101
+
### benchmark
102
+
103
+
The different types of compile-time benchmarks that are run.
104
+
105
+
The table stores the name of the benchmark as well as whether it is capable of being run using the stable compiler and what is its category.
106
+
The benchmark name is used as a foreign key in many of the other tables.
107
+
108
+
Category is either `primary` (real-world benchmark) or `secondary` (stress test).
109
+
Stable benchmarks have `category` set to `primary` and `stabilized` set to `1`.
110
+
111
+
```
112
+
sqlite> select * from runtime_benchmark limit 1;
113
+
name stabilized category
114
+
---------- ---------- ----------
115
+
helloworld 0 primary
116
+
```
117
+
93
118
### pstat_series
94
119
95
-
A unique collection of crate, profile, cache and statistic.
120
+
Describes the parametrization of a compile-time benchmark. Contains a unique combination
121
+
of a crate, profile, scenario and the metric being collected.
96
122
97
-
* crate: the benchmarked crate which might be a crate from crates.io or a crate made specifically to stress some part of the compiler.
123
+
* crate (aka `benchmark`): the benchmarked crate which might be a crate from crates.io or a crate made specifically to stress some part of the compiler.
98
124
* profile: what type of compilation is happening - check build, optimized build (a.k.a. release build), debug build, or doc build.
99
-
* cache: how much of the incremental cache is full. An empty incremental cache means that the compiler must do a full build.
100
-
* statistic: the type of stat being collected
125
+
* cache (aka `scenario`): describes how much of the incremental cache is full. An empty incremental cache means that the compiler must do a full build.
126
+
* statistic (aka `metric`): the type of metric being collected
127
+
128
+
There is a separate table for this collection to avoid duplicating crates, prfiles, scenarios etc.
0 commit comments