MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / print_worker_list

Method print_worker_list

crates/hyperqueue/src/client/output/cli.rs:228–262  ·  view source on GitHub ↗
(&self, workers: Vec<WorkerInfo>)

Source from the content-addressed store, hash-verified

226
227impl Output for CliOutput {
228 fn print_worker_list(&self, workers: Vec<WorkerInfo>) {
229 let rows: Vec<_> = workers
230 .into_iter()
231 .map(|worker| {
232 let manager_info = worker.configuration.get_manager_info();
233 vec![
234 worker.id.cell().justify(Justify::Right),
235 worker_status(&worker),
236 worker.configuration.hostname.cell(),
237 resources_summary(&worker.configuration.resources, false).cell(),
238 manager_info
239 .as_ref()
240 .map(|info| info.manager.to_string())
241 .unwrap_or_else(|| "None".to_string())
242 .cell(),
243 manager_info
244 .as_ref()
245 .map(|info| info.allocation_id.as_str())
246 .unwrap_or("N/A")
247 .to_string()
248 .cell(),
249 ]
250 })
251 .collect();
252
253 let header = vec![
254 "ID".cell(),
255 "State".cell().bold(true),
256 "Hostname".cell().bold(true),
257 "Resources".cell().bold(true),
258 "Manager".cell().bold(true),
259 "Manager Job ID".cell().bold(true),
260 ];
261 self.print_horizontal_table(rows, header);
262 }
263
264 fn print_worker_info(&self, workers: Vec<WorkerInfo>) {
265 for (i, worker_info) in workers.into_iter().enumerate() {

Callers 1

command_worker_listFunction · 0.45

Calls 3

get_manager_infoMethod · 0.80
into_iterMethod · 0.45

Tested by

no test coverage detected