1
- export const BenchmarkRequestCompleteStr = "completed" ;
2
- export const BenchmarkRequestInProgressStr = "in_progress" ;
3
- export const BenchmarkRequestArtifactsReadyStr = "artifacts_ready" ;
1
+ export type BenchmarkRequestType = "Release" | "Master" | "Try" ;
2
+ export type BenchmarkRequestStatus = "Queued" | "InProgress" | "Completed" ;
4
3
5
- type BenchmarkRequestStatusComplete = {
6
- state : typeof BenchmarkRequestCompleteStr ;
7
- completedAt : string ;
8
- duration_s : number ;
9
- } ;
10
-
11
- type BenchmarkRequestStatusInProgress = {
12
- state : typeof BenchmarkRequestInProgressStr ;
13
- } ;
14
-
15
- type BenchmarkRequestStatusArtifactsReady = {
16
- state : typeof BenchmarkRequestArtifactsReadyStr ;
17
- } ;
18
-
19
- export type BenchmarkRequestStatus =
20
- | BenchmarkRequestStatusComplete
21
- | BenchmarkRequestStatusInProgress
22
- | BenchmarkRequestStatusArtifactsReady ;
23
-
24
- export const TryCommit = "Try" ;
25
- export const MasterCommit = "Master" ;
26
- export const ReleaseCommit = "Release" ;
27
-
28
- type BenchmarkRequestTypeTry = {
29
- type : typeof TryCommit ;
30
- tag : string | null ;
31
- parent_sha : string | null ;
32
- pr : number ;
33
- } ;
34
-
35
- type BenchmarkRequestTypeMaster = {
36
- type : typeof MasterCommit ;
4
+ export type BenchmarkRequest = {
37
5
tag : string ;
38
- parent_sha : string ;
39
- pr : number ;
40
- } ;
41
-
42
- type BenchmarkRequestTypeRelease = {
43
- type : typeof ReleaseCommit ;
44
- tag : string ;
45
- } ;
46
-
47
- export type BenchmarkRequestTypeStr =
48
- | typeof ReleaseCommit
49
- | typeof MasterCommit
50
- | typeof TryCommit ;
51
-
52
- export type BenchmarkRequestType =
53
- | BenchmarkRequestTypeTry
54
- | BenchmarkRequestTypeMaster
55
- | BenchmarkRequestTypeRelease ;
56
-
57
- export type BenchmarkRequestComplete = {
58
- status : BenchmarkRequestStatusComplete ;
59
- requestType : BenchmarkRequestType ;
60
- commitDate : string | null ;
61
- createdAt : string | null ;
62
- backends : string [ ] ;
63
- profiles : string ;
64
- errors : string [ ] ;
65
- } ;
66
-
67
- export type BenchmarkRequestInProgress = {
68
- status : BenchmarkRequestStatusInProgress ;
6
+ pr : number | null ;
7
+ status : BenchmarkRequestStatus ;
69
8
requestType : BenchmarkRequestType ;
70
- commitDate : string | null ;
71
- createdAt : string | null ;
72
- backends : string [ ] ;
73
- profiles : string ;
74
- errors : string [ ] ;
75
- } ;
76
-
77
- export type BenchmarkRequestArtifactsReady = {
78
- status : BenchmarkRequestStatusArtifactsReady ;
79
- requestType : BenchmarkRequestType ;
80
- commitDate : string | null ;
81
- createdAt : string | null ;
82
- backends : string [ ] ;
83
- profiles : string ;
84
- errors : string [ ] ;
85
- } ;
86
-
87
- export type BenchmarkRequest =
88
- | BenchmarkRequestComplete
89
- | BenchmarkRequestInProgress
90
- | BenchmarkRequestArtifactsReady ;
91
-
92
- export const BenchmarkJobQueued = "queued" ;
93
- export const BenchmarkJobInProgress = "in_progres" ;
94
- export const BenchmarkJobFailed = "failed" ;
95
- export const BenchmarkJobSuccess = "success" ;
96
-
97
- export type BenchmarkJobStatusQueued = {
98
- state : typeof BenchmarkJobQueued ;
99
- } ;
100
-
101
- export type BenchmarkJobStatusInProgress = {
102
- state : typeof BenchmarkJobInProgress ;
103
- startedAt : string ;
104
- collectorName : string ;
105
- } ;
106
-
107
- export type BenchmarkJobStatusFailed = {
108
- state : typeof BenchmarkJobFailed ;
109
- startedAt : string ;
110
- completedAt : string ;
111
- collectorName : string ;
112
- } ;
113
-
114
- export type BenchmarkJobStatusSuccess = {
115
- state : typeof BenchmarkJobSuccess ;
116
- startedAt : string ;
117
- completedAt : string ;
118
- collectorName : string ;
9
+ createdAt : string ;
10
+ completedAt : string | null ;
11
+ durationS : number | null ;
12
+ errors : Dict < string > ;
119
13
} ;
120
14
121
- export type BenchmarkJobStatusStr =
122
- | typeof BenchmarkJobQueued
123
- | typeof BenchmarkJobInProgress
124
- | typeof BenchmarkJobFailed
125
- | typeof BenchmarkJobSuccess ;
126
-
127
- export type BenchmarkJobStatus =
128
- | BenchmarkJobStatusSuccess
129
- | BenchmarkJobStatusFailed
130
- | BenchmarkJobStatusInProgress
131
- | BenchmarkJobStatusQueued ;
15
+ export type BenchmarkJobStatus = "Queued" | "InProgress" | "Success" | "Failed" ;
132
16
133
17
export type BenchmarkJob = {
18
+ requestTag : string ;
134
19
target : string ;
135
20
backend : string ;
136
21
profile : string ;
137
- requestTag : string ;
138
22
benchmarkSet : number ;
139
23
createdAt : string ;
24
+ startedAt : string | null ;
25
+ completedAt : string | null ;
140
26
status : BenchmarkJobStatus ;
141
27
dequeCounter : number ;
142
28
} ;
@@ -148,17 +34,10 @@ export type CollectorConfig = {
148
34
isActive : boolean ;
149
35
lastHeartbeatAt : string ;
150
36
dateAdded : string ;
151
- } ;
152
-
153
- export type CollectorInfo = {
154
- config : CollectorConfig ;
155
- jobIds : number [ ] ;
37
+ jobs : BenchmarkJob [ ] ;
156
38
} ;
157
39
158
40
export type StatusResponse = {
159
- queueRequestTags : string [ ] ;
160
- requestsMap : Dict < BenchmarkRequest > ;
161
- jobMap : Dict < BenchmarkJob > ;
162
- collectorWorkMap : Dict < CollectorInfo > ;
163
- tagToJobs : Dict < number [ ] > ;
41
+ requests : BenchmarkRequest [ ] ;
42
+ collectors : CollectorConfig [ ] ;
164
43
} ;
0 commit comments