feat: Add units to read_rate and read_time meta plugins
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -80,9 +80,9 @@ impl MetaPlugin for ReadTimeMetaPlugin {
|
|||||||
fn finalize(&mut self) -> io::Result<String> {
|
fn finalize(&mut self) -> io::Result<String> {
|
||||||
if let Some(start_time) = self.start_time {
|
if let Some(start_time) = self.start_time {
|
||||||
let duration = start_time.elapsed();
|
let duration = start_time.elapsed();
|
||||||
Ok(format!("{:.6}", duration.as_secs_f64()))
|
Ok(format!("{:.6}s", duration.as_secs_f64()))
|
||||||
} else {
|
} else {
|
||||||
Ok("0.000000".to_string())
|
Ok("0.000000s".to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,12 +125,12 @@ impl MetaPlugin for ReadRateMetaPlugin {
|
|||||||
let duration = start_time.elapsed();
|
let duration = start_time.elapsed();
|
||||||
if duration.as_secs_f64() > 0.0 {
|
if duration.as_secs_f64() > 0.0 {
|
||||||
let rate = self.bytes_read as f64 / duration.as_secs_f64();
|
let rate = self.bytes_read as f64 / duration.as_secs_f64();
|
||||||
Ok(format!("{:.0}", rate))
|
Ok(format!("{:.0} B/s", rate))
|
||||||
} else {
|
} else {
|
||||||
Ok("0".to_string())
|
Ok("0 B/s".to_string())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok("0".to_string())
|
Ok("0 B/s".to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user