| 125 | } |
| 126 | |
| 127 | fn eta(progress: &Progress, elapsed: Duration) -> String { |
| 128 | if progress.phase == "complete" { |
| 129 | return "complete".into(); |
| 130 | } |
| 131 | let remaining = progress.total.saturating_sub(progress.published); |
| 132 | let rate = rate(progress, elapsed); |
| 133 | if remaining == 0 { |
| 134 | "final proof separate".into() |
| 135 | } else if rate > 0.0 { |
| 136 | format!("~{:.0}s + final proof", remaining as f64 / rate) |
| 137 | } else { |
| 138 | "estimating...".into() |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | fn plain(progress: &Progress, sample: &Resources, cpu: Option<f64>, elapsed: Duration) -> String { |
| 143 | format!("Rolling import | {} | {:.1}s | staged {}/{} | {:.1} commits/s | ETA {}\nwindow {}/{} | checked {} | loaded {} | in flight {} | blob reservation {} / {}\nprocess RSS {} | peak {} | CPU {}\n", |