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" ;
43
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 = {
375 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 ;
698 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 > ;
11913} ;
12014
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" ;
13216
13317export type BenchmarkJob = {
18+ requestTag : string ;
13419 target : string ;
13520 backend : string ;
13621 profile : string ;
137- requestTag : string ;
13822 benchmarkSet : number ;
13923 createdAt : string ;
24+ startedAt : string | null ;
25+ completedAt : string | null ;
14026 status : BenchmarkJobStatus ;
14127 dequeCounter : number ;
14228} ;
@@ -148,17 +34,10 @@ export type CollectorConfig = {
14834 isActive : boolean ;
14935 lastHeartbeatAt : string ;
15036 dateAdded : string ;
151- } ;
152-
153- export type CollectorInfo = {
154- config : CollectorConfig ;
155- jobIds : number [ ] ;
37+ jobs : BenchmarkJob [ ] ;
15638} ;
15739
15840export 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 [ ] ;
16443} ;
0 commit comments