@@ -13,6 +13,7 @@ import {useExpandedStore} from "../../utils/expansion";
1313import {
1414 BenchmarkRequest ,
1515 BenchmarkRequestStatus ,
16+ BenchmarkJob ,
1617 CollectorConfig ,
1718 StatusResponse ,
1819} from " ./data" ;
@@ -122,6 +123,32 @@ function PullRequestLink({request}: {request: BenchmarkRequest}) {
122123 );
123124}
124125
126+ // This works off the assumption that all of the collectors are working on the
127+ // same request.
128+ function getJobCompletion(
129+ req : BenchmarkRequest ,
130+ collectors : CollectorConfig []
131+ ) {
132+ const sampleJob = collectors ?.[0 ]?.jobs ?.[0 ];
133+ if (! sampleJob ) return " " ;
134+ if (sampleJob .requestTag !== req .tag ) return " " ;
135+
136+ const allJobs: BenchmarkJob [] = [];
137+ for (const collector of collectors ) {
138+ allJobs .push (... collector .jobs );
139+ }
140+ const completed = allJobs .reduce ((acc , job ) => {
141+ if (job .status === " Failed" || job .status === " Success" ) {
142+ acc += 1 ;
143+ }
144+ return acc ;
145+ }, 0 );
146+ if (allJobs .length ) {
147+ return ` ${completed } / ${allJobs .length } ` ;
148+ }
149+ return " " ;
150+ }
151+
125152const {toggleExpanded : toggleExpandedErrors, isExpanded : hasExpandedErrors} =
126153 useExpandedStore ();
127154
@@ -143,6 +170,7 @@ loadStatusData(loading);
143170 <th >Kind</th >
144171 <th >Tag</th >
145172 <th >Status</th >
173+ <th >Jobs Complete</th >
146174 <th >Completed At</th >
147175 <th >Duration</th >
148176 <th >Errors</th >
@@ -162,6 +190,9 @@ loadStatusData(loading);
162190 req.status === "Completed" && req.hasPendingJobs ? "*" : ""
163191 }}
164192 </td >
193+ <td >
194+ {{ getJobCompletion(req, data.collectors) }}
195+ </td >
165196 <td >
166197 {{ formatISODate(req.completedAt) }}
167198 <span v-if =" req.endEstimated" >(est.)</span >
0 commit comments