MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / print_status_header

Function print_status_header

src/display.rs:108–139  ·  view source on GitHub ↗
(
    stats: &GraphStats,
    tokens_saved: u64,
    global_tokens_saved: Option<u64>,
    worldwide: Option<u64>,
    country_flags: &[String],
    branch_info: Option<&BranchInfo>,
    cost_info: Op

Source from the content-addressed store, hash-verified

106}
107
108pub fn print_status_header(
109 stats: &GraphStats,
110 tokens_saved: u64,
111 global_tokens_saved: Option<u64>,
112 worldwide: Option<u64>,
113 country_flags: &[String],
114 branch_info: Option<&BranchInfo>,
115 cost_info: Option<&CostRow>,
116) {
117 let num_cols = 3;
118 let mut sorted_kinds: Vec<_> = stats.nodes_by_kind.iter().collect();
119 sorted_kinds.sort_by_key(|(k, _)| (*k).clone());
120 let cell_width = compute_cell_width(&sorted_kinds);
121 let inner_width = cell_width * num_cols + (num_cols - 1);
122
123 println!("{}", table_separator('╭', '─', '╮', cell_width, num_cols));
124 print_version_flags_row(country_flags, inner_width);
125 print_tokens_row(tokens_saved, global_tokens_saved, worldwide, inner_width);
126 if let Some(ci) = cost_info {
127 print_cost_row(ci, inner_width);
128 }
129 print_sync_row(
130 stats.last_sync_at,
131 stats.last_full_sync_at,
132 stats.last_sync_duration_ms,
133 inner_width,
134 );
135 if let Some(bi) = branch_info {
136 print_branch_row(bi, inner_width);
137 }
138 println!("{}", table_separator('╰', '─', '╯', cell_width, num_cols));
139}
140
141/// Prints the status output as a compact bordered table.
142#[allow(clippy::too_many_arguments)]

Calls 7

compute_cell_widthFunction · 0.85
print_version_flags_rowFunction · 0.85
print_tokens_rowFunction · 0.85
print_sync_rowFunction · 0.85
print_branch_rowFunction · 0.85
collectMethod · 0.80
print_cost_rowFunction · 0.70