@@ -305,9 +305,10 @@ type poolOrchestrator struct {
305
305
306
306
// aiPoolInfo contains information about an AI pool.
307
307
type aiPoolInfo struct {
308
- Size int `json:"size"`
309
- InUse int `json:"in_use"`
310
- Orchestrators []poolOrchestrator `json:"orchestrators"`
308
+ Size int `json:"size"`
309
+ InUse int `json:"in_use"`
310
+ Orchestrators []poolOrchestrator `json:"orchestrators"`
311
+ OnHold map [string ][]poolOrchestrator `json:"on_hold"`
311
312
}
312
313
313
314
// suspendedInfo contains information about suspended orchestrators.
@@ -342,8 +343,9 @@ func (s *LivepeerServer) getAIPoolsInfoHandler() http.Handler {
342
343
// Loop through selectors and get pools info.
343
344
for cap , pool := range s .AISessionManager .selectors {
344
345
warmPool := aiPoolInfo {
345
- Size : pool .warmPool .Size (),
346
- InUse : len (pool .warmPool .inUseSess ),
346
+ Size : pool .warmPool .Size (),
347
+ InUse : len (pool .warmPool .inUseSess ),
348
+ OnHold : make (map [string ][]poolOrchestrator ),
347
349
}
348
350
for _ , sess := range pool .warmPool .sessMap {
349
351
poolOrchestrator := poolOrchestrator {
@@ -353,6 +355,16 @@ func (s *LivepeerServer) getAIPoolsInfoHandler() http.Handler {
353
355
}
354
356
warmPool .Orchestrators = append (warmPool .Orchestrators , poolOrchestrator )
355
357
}
358
+ for id , sessions := range pool .warmPool .sessionsOnHold {
359
+ for _ , sess := range sessions {
360
+ poolOrchestrator := poolOrchestrator {
361
+ Url : sess .Transcoder (),
362
+ LatencyScore : sess .LatencyScore ,
363
+ InFlight : len (sess .SegsInFlight ),
364
+ }
365
+ warmPool .OnHold [id ] = append (warmPool .OnHold [id ], poolOrchestrator )
366
+ }
367
+ }
356
368
357
369
coldPool := aiPoolInfo {
358
370
Size : pool .coldPool .Size (),
@@ -365,7 +377,16 @@ func (s *LivepeerServer) getAIPoolsInfoHandler() http.Handler {
365
377
InFlight : len (sess .SegsInFlight ),
366
378
})
367
379
}
368
-
380
+ for id , sessions := range pool .coldPool .sessionsOnHold {
381
+ for _ , sess := range sessions {
382
+ poolOrchestrator := poolOrchestrator {
383
+ Url : sess .Transcoder (),
384
+ LatencyScore : sess .LatencyScore ,
385
+ InFlight : len (sess .SegsInFlight ),
386
+ }
387
+ coldPool .OnHold [id ] = append (coldPool .OnHold [id ], poolOrchestrator )
388
+ }
389
+ }
369
390
aiPoolsInfoResp [cap ] = aiOrchestratorPools {
370
391
Cold : coldPool ,
371
392
Warm : warmPool ,
0 commit comments