Skip to content

Commit b550d9a

Browse files
committed
Update schema docs with diagram
1 parent 06c890f commit b550d9a

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

database/schema.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22

33
Below is an explanation of the current database schema. This schema is duplicated across the (currently) two database backends we support: sqlite and postgres.
44

5+
6+
## Overview
7+
8+
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.
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.)
12+
13+
Below are some diagrams showing the basic layout of the database schema for these three uses:
14+
15+
### Performance run statistics
16+
17+
```
18+
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
19+
│ benchmarks │ │ collections │ │ artifacts │
20+
├───────────────┤ ├───────────────┤ ├───────────────┤
21+
┌►│ id * │ │ id * │◄┐│ id * │◄┐
22+
│ │ name │ │ commit │ ││ name │ │
23+
│ │ runs_on_stable│ │ │ ││ date │ │
24+
│ │ │ │ │ ││ type │ │
25+
│ └───────────────┘ └───────────────┘ │└───────────────┘ │
26+
│ │ │
27+
│ │ │
28+
│ ┌───────────────┐ ┌───────────────┐ | │
29+
│ │ pstat_series │ │ pstats │ │ │
30+
│ ├───────────────┤ ├───────────────┤ │ │
31+
│ │ id * │◄┐│ id * │ │ │
32+
└─┤ benchmark_id │ └┤ series_id │ │ │
33+
│ profile │ │ artifact_id ├─┼──────────────────┘
34+
│ cache │ │ collection_id ├─┘
35+
│ statistic │ │ value │
36+
└───────────────┘ └───────────────┘
37+
```
38+
39+
### Self profile data
40+
41+
**TODO**
42+
43+
### Miscellaneous State
44+
45+
**TODO**
46+
547
## Tables
648

749
### benchmark
@@ -22,7 +64,7 @@ helloworld 0
2264
A description of a rustc compiler artifact being benchmarked.
2365

2466
This description includes:
25-
* name: usually a commit sha or a tag like "1.51.0"
67+
* name: usually a commit sha or a tag like "1.51.0" but is free-form text so can be anything.
2668
* date: the date associated with this compiler artifact (usually only when the name is a commit)
2769
* 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).
2870

@@ -80,10 +122,16 @@ series aid cid value
80122

81123
### self_profile_query_series
82124

125+
**TODO**
126+
83127
### self_profile_query
84128

129+
**TODO**
130+
85131
### pull_request_builds
86132

133+
**TODO**
134+
87135
### artifact_collection_duration
88136

89137
Records how long benchmarking takes in seconds.
@@ -108,6 +156,12 @@ aid step start end
108156

109157
### rustc_compilation
110158

159+
**TODO**
160+
111161
### error_series
112162

113-
### error
163+
**TODO**
164+
165+
### error
166+
167+
**TODO**

0 commit comments

Comments
 (0)