mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-29 20:50:22 +00:00
Merge pull request #557 from sched-ext/htejun/scx_stats-more
scx_stats: Make StatsServerData::describe_meta() output more readable
This commit is contained in:
commit
2f356bf09e
@ -294,7 +294,7 @@ where
|
||||
self.visit_meta(from, &mut |m| {
|
||||
nwidth = nwidth.max(m.name.len());
|
||||
(fwidth, dwidth) = m.fields.iter().fold((fwidth, dwidth), |acc, (n, f)| {
|
||||
(acc.0.max(n.len()), acc.1.max(f.data.to_string().len()))
|
||||
(acc.0.max(n.len()), acc.1.max(f.data.to_string().len() + 2))
|
||||
});
|
||||
Ok(())
|
||||
})?;
|
||||
@ -317,12 +317,12 @@ where
|
||||
w,
|
||||
" {:fw$} {:dw$}",
|
||||
fname,
|
||||
f.data.to_string(),
|
||||
format!("({})", f.data.to_string()),
|
||||
fw = fwidth,
|
||||
dw = dwidth
|
||||
)?;
|
||||
if let Some(desc) = &f.attrs.desc {
|
||||
write!(w, " {}", desc)?;
|
||||
write!(w, " : {}", desc)?;
|
||||
}
|
||||
writeln!(w, "")?;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user