Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions batch_ssh/batch_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def load_config(path):

def ssh(host: Host, command: str, timeout: int) -> Result:
ssh_cmd = [
"ssh",
"ssh",
"-p", host.port,
"-o", f"ConnectTimeout={timeout}",
"-o", "StrictHostKeyChecking=no",
Expand Down Expand Up @@ -113,19 +113,20 @@ def main():
max_prefix_len = max(max_prefix_len, len(prefix))
entry.append(prefix)

for i, entry in enumerate(res):
host, future, prefix = entry

for host, future, prefix in res:
future_res = future.result()
output = future_res.output.strip()
if future_res.returncode is None:
assert("\n" not in output)
output = f"exception: {output}"
suffix = "---"
else:
suffix = future_res.returncode

output_lines = output.splitlines(keepends=True)
# 处理缩进
output = output_lines[0] + "".join(textwrap.indent("".join(output_lines[1:]), " " * (max_prefix_len + 13)))
print(f"[{prefix:<{max_prefix_len}}][ret: {future_res.returncode:>3}] {output}")
output = output_lines[0] + "".join(textwrap.indent("".join(output_lines[1:]), " " * (max_prefix_len + 8)))
print(f"[{prefix:<{max_prefix_len}}][{suffix:>3}] {output}")

if __name__ == "__main__":
main()
Binary file added gantt/big_input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
324 changes: 324 additions & 0 deletions gantt/big_input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
timestamp: 2026-09-08 19:38:07.431900

gantt results:
#, begin, duration, task, size
io-thread-00, 0.000, 0.000, sort, medium
io-thread-00, 0.000, 0.200, write, tiny
io-thread-00, 0.700, 0.005, dispatch, large
io-thread-00, 0.405, 0.000, sync, small
io-thread-00, 0.405, 8.000, poll, tiny
io-thread-00, 8.905, 0.200, merge, xlarge
io-thread-00, 9.205, 0.200, link, xlarge
io-thread-00, 9.405, 0.000, fsync, large
io-thread-00, 9.405, 0.500, write, small
io-thread-00, 9.905, 0.005, sync, large
worker-01, 0.000, 1.000, alloc, xlarge
worker-01, 1.000, 0.000, sort, large
worker-01, 1.500, 0.005, free, tiny
worker-01, 2.005, 0.500, flush, xlarge
worker-01, 2.505, 0.200, merge, tiny
worker-01, 2.405, 0.200, send, tiny
worker-01, 2.605, 0.005, free, medium
worker-01, 2.710, 1.000, fsync, medium
worker-01, 3.710, 0.200, checkpoint, medium
worker-01, 3.610, 0.050, serialize, small
worker-02, 0.000, 5.000, free, medium
worker-02, 5.500, 0.200, checkpoint, medium
worker-02, 5.400, 0.200, compute, medium
worker-02, 5.700, 0.500, sync, small
worker-02, 6.700, 1.000, kernel-A, large
worker-02, 7.800, 5.000, write, medium
worker-02, 12.800, 0.200, sort, xlarge
worker-02, 13.500, 0.500, sort, xlarge
worker-02, 14.100, 2.500, alloc, small
worker-02, 16.600, 8.000, optimize, tiny
io-thread-03, 0.000, 0.005, write, small
io-thread-03, 0.105, 0.005, free, large
io-thread-03, 0.610, 5.000, parse, medium
io-thread-03, 6.110, 0.000, checkpoint, tiny
io-thread-03, 6.610, 0.500, flush, medium
io-thread-03, 6.810, 0.500, compile, small
io-thread-03, 7.410, 0.000, sort, medium
io-thread-03, 7.910, 0.050, parse, tiny
io-thread-03, 7.960, 8.000, poll, small
io-thread-03, 15.960, 1.000, fsync, xlarge
worker-04, 0.500, 0.000, poll, medium
worker-04, 0.600, 0.000, read, medium
worker-04, 0.600, 0.200, compute, small
worker-04, 1.300, 0.005, sync, large
worker-04, 1.005, 8.000, write, small
worker-04, 9.105, 8.000, fsync, medium
worker-04, 17.605, 2.500, kernel-A, xlarge
worker-04, 20.105, 0.500, free, medium
worker-04, 20.705, 8.000, link, tiny
worker-04, 28.705, 0.200, sync, medium
worker-05, 0.000, 8.000, kernel-B, xlarge
worker-05, 8.000, 0.000, sync, tiny
worker-05, 8.000, 0.005, compute, medium
worker-05, 7.705, 8.000, kernel-B, medium
worker-05, 15.805, 0.200, serialize, small
worker-05, 16.505, 5.000, kernel-B, large
worker-05, 21.605, 0.200, read, tiny
worker-05, 21.905, 1.000, compile, large
worker-05, 23.005, 0.000, checkpoint, tiny
worker-05, 22.705, 2.500, sort, medium
io-thread-06, 0.000, 0.200, kernel-A, small
io-thread-06, 0.700, 5.000, write, large
io-thread-06, 5.700, 0.500, link, small
io-thread-06, 5.900, 5.000, serialize, tiny
io-thread-06, 10.600, 8.000, init, tiny
io-thread-06, 18.600, 0.050, compile, large
io-thread-06, 18.750, 0.200, free, tiny
io-thread-06, 18.950, 2.500, init, large
io-thread-06, 21.450, 5.000, send, large
io-thread-06, 26.950, 5.000, write, small
worker-07, 0.000, 0.200, compute, xlarge
worker-07, 0.700, 0.000, sort, medium
worker-07, 0.400, 0.000, dispatch, large
worker-07, 0.900, 8.000, fsync, tiny
worker-07, 9.400, 0.005, fsync, tiny
worker-07, 9.905, 0.005, checkpoint, small
worker-07, 10.010, 0.005, dispatch, small
worker-07, 10.515, 0.000, poll, tiny
worker-07, 10.615, 8.000, ping, medium
worker-07, 18.615, 1.000, kernel-B, medium
worker-08, 0.100, 0.050, checkpoint, medium
worker-08, 0.250, 1.000, sync, tiny
worker-08, 1.350, 0.005, sync, xlarge
worker-08, 1.355, 8.000, recv, small
worker-08, 9.355, 0.005, kernel-B, medium
worker-08, 9.360, 0.050, link, xlarge
worker-08, 9.410, 8.000, init, xlarge
worker-08, 17.410, 0.005, write, medium
worker-08, 17.115, 0.005, sort, xlarge
worker-08, 17.120, 0.500, send, xlarge
io-thread-09, 0.000, 1.000, kernel-A, medium
io-thread-09, 1.500, 5.000, recv, tiny
io-thread-09, 6.200, 2.500, recv, tiny
io-thread-09, 8.400, 1.000, write, medium
io-thread-09, 9.400, 5.000, serialize, large
io-thread-09, 14.900, 0.000, read, tiny
io-thread-09, 14.900, 8.000, compute, medium
io-thread-09, 23.400, 8.000, write, large
io-thread-09, 31.400, 0.000, send, medium
io-thread-09, 31.100, 1.000, kernel-A, small
worker-10, 0.000, 1.000, serialize, large
worker-10, 1.500, 0.050, kernel-B, small
worker-10, 1.550, 2.500, init, small
worker-10, 4.050, 2.500, checkpoint, small
worker-10, 6.550, 0.050, merge, tiny
worker-10, 6.700, 0.000, optimize, small
worker-10, 6.700, 5.000, alloc, medium
worker-10, 11.700, 0.200, init, small
worker-10, 12.000, 1.000, recv, tiny
worker-10, 13.000, 1.000, flush, xlarge
worker-11, 0.100, 8.000, ping, tiny
worker-11, 7.800, 0.500, fsync, xlarge
worker-11, 8.300, 0.000, read, xlarge
worker-11, 8.400, 1.000, sort, medium
worker-11, 9.500, 8.000, read, large
worker-11, 18.000, 0.200, recv, tiny
worker-11, 18.300, 0.000, parse, xlarge
worker-11, 18.300, 1.000, compile, tiny
worker-11, 19.300, 1.000, checkpoint, tiny
worker-11, 20.300, 8.000, send, large
io-thread-12, 0.000, 2.500, merge, medium
io-thread-12, 3.000, 0.050, kernel-A, large
io-thread-12, 3.150, 0.050, poll, xlarge
io-thread-12, 3.200, 2.500, serialize, tiny
io-thread-12, 5.700, 0.500, kernel-A, large
io-thread-12, 6.700, 1.000, link, large
io-thread-12, 7.800, 0.200, parse, large
io-thread-12, 8.000, 0.005, send, xlarge
io-thread-12, 8.505, 1.000, sync, small
io-thread-12, 9.505, 0.200, kernel-A, small
worker-13, 0.000, 0.000, kernel-B, large
worker-13, 0.500, 0.005, link, large
worker-13, 1.005, 0.200, merge, large
worker-13, 1.305, 2.500, kernel-B, small
worker-13, 3.505, 0.005, compile, small
worker-13, 3.510, 8.000, link, tiny
worker-13, 12.010, 0.200, read, large
worker-13, 12.210, 5.000, checkpoint, xlarge
worker-13, 17.710, 1.000, link, xlarge
worker-13, 19.210, 2.500, serialize, large
worker-14, 0.000, 5.000, link, medium
worker-14, 5.000, 0.500, parse, large
worker-14, 5.500, 0.500, link, tiny
worker-14, 6.000, 0.200, recv, medium
worker-14, 6.200, 8.000, sync, small
worker-14, 14.200, 0.200, free, small
worker-14, 14.400, 0.005, compile, large
worker-14, 14.405, 8.000, link, large
worker-14, 22.105, 0.200, compile, large
worker-14, 22.805, 0.000, dispatch, large
io-thread-15, 0.100, 0.000, alloc, medium
io-thread-15, 0.200, 2.500, serialize, xlarge
io-thread-15, 3.200, 0.200, optimize, small
io-thread-15, 3.400, 2.500, optimize, tiny
io-thread-15, 6.000, 1.000, checkpoint, large
io-thread-15, 7.000, 5.000, write, xlarge
io-thread-15, 12.500, 0.000, free, xlarge
io-thread-15, 13.000, 0.000, sync, large
io-thread-15, 13.000, 5.000, fsync, tiny
io-thread-15, 18.000, 2.500, ping, small
worker-16, 0.100, 1.000, ping, large
worker-16, 1.100, 2.500, recv, tiny
worker-16, 3.700, 0.000, sort, xlarge
worker-16, 3.400, 1.000, kernel-B, tiny
worker-16, 4.100, 0.000, kernel-B, small
worker-16, 3.800, 0.050, kernel-B, small
worker-16, 3.950, 0.005, dispatch, small
worker-16, 4.055, 0.500, alloc, small
worker-16, 5.055, 0.005, fsync, medium
worker-16, 4.760, 0.000, send, xlarge
worker-17, 0.100, 2.500, merge, small
worker-17, 2.300, 0.200, read, medium
worker-17, 3.000, 0.005, dispatch, tiny
worker-17, 3.005, 8.000, compile, medium
worker-17, 10.705, 8.000, flush, medium
worker-17, 18.405, 2.500, optimize, tiny
worker-17, 21.005, 1.000, flush, large
worker-17, 22.005, 2.500, fsync, xlarge
worker-17, 24.505, 8.000, optimize, large
worker-17, 32.605, 0.500, ping, small
io-thread-18, 0.000, 0.500, link, small
io-thread-18, 0.600, 2.500, ping, tiny
io-thread-18, 3.200, 1.000, fsync, large
io-thread-18, 4.200, 1.000, recv, medium
io-thread-18, 5.200, 0.500, serialize, tiny
io-thread-18, 6.200, 0.200, sync, small
io-thread-18, 6.500, 5.000, serialize, small
io-thread-18, 11.600, 5.000, link, tiny
io-thread-18, 16.300, 0.500, kernel-B, large
io-thread-18, 16.800, 0.500, checkpoint, xlarge
worker-19, 0.000, 5.000, serialize, xlarge
worker-19, 5.000, 2.500, sort, xlarge
worker-19, 7.500, 1.000, merge, large
worker-19, 8.500, 0.500, recv, small
worker-19, 8.700, 0.200, ping, tiny
worker-19, 9.400, 0.050, kernel-A, small
worker-19, 9.550, 0.500, sort, xlarge
worker-19, 10.550, 0.500, read, small
worker-19, 11.050, 0.200, alloc, small
worker-19, 11.250, 0.000, merge, xlarge
worker-20, 0.000, 0.500, compute, tiny
worker-20, 1.000, 0.500, merge, small
worker-20, 1.600, 0.005, init, xlarge
worker-20, 1.605, 5.000, optimize, large
worker-20, 6.605, 0.050, compute, medium
worker-20, 6.755, 0.005, sync, large
worker-20, 6.860, 0.005, dispatch, tiny
worker-20, 6.865, 0.050, dispatch, medium
worker-20, 6.615, 0.200, read, xlarge
worker-20, 6.915, 0.200, parse, large
io-thread-21, 0.100, 5.000, send, xlarge
io-thread-21, 5.200, 0.500, dispatch, xlarge
io-thread-21, 5.400, 0.005, kernel-A, small
io-thread-21, 5.405, 0.005, fsync, small
io-thread-21, 5.410, 8.000, sync, small
io-thread-21, 13.110, 2.500, link, xlarge
io-thread-21, 15.710, 0.500, compute, small
io-thread-21, 16.210, 0.500, merge, large
io-thread-21, 16.410, 0.200, recv, xlarge
io-thread-21, 16.610, 2.500, read, xlarge
worker-22, 0.000, 0.050, recv, small
worker-22, 0.000, 0.000, fsync, medium
worker-22, 0.500, 0.500, link, tiny
worker-22, 1.100, 0.500, merge, large
worker-22, 1.600, 8.000, serialize, large
worker-22, 9.700, 0.005, poll, tiny
worker-22, 9.805, 1.000, poll, medium
worker-22, 10.505, 0.005, kernel-B, xlarge
worker-22, 11.010, 0.000, checkpoint, medium
worker-22, 11.510, 0.000, fsync, large
worker-23, 0.500, 5.000, recv, small
worker-23, 6.000, 2.500, flush, large
worker-23, 8.200, 5.000, alloc, large
worker-23, 13.200, 1.000, checkpoint, tiny
worker-23, 14.200, 1.000, compile, large
worker-23, 15.200, 2.500, serialize, tiny
worker-23, 17.800, 0.005, ping, medium
worker-23, 17.805, 0.005, free, xlarge
worker-23, 17.510, 8.000, link, large
worker-23, 25.210, 0.200, parse, medium
io-thread-24, 0.500, 5.000, flush, large
io-thread-24, 5.200, 0.200, recv, xlarge
io-thread-24, 5.400, 0.500, link, large
io-thread-24, 5.600, 0.000, flush, xlarge
io-thread-24, 5.600, 0.050, send, xlarge
io-thread-24, 5.350, 8.000, compile, tiny
io-thread-24, 13.350, 0.005, link, tiny
io-thread-24, 13.355, 5.000, merge, medium
io-thread-24, 18.855, 0.500, compile, large
io-thread-24, 19.455, 0.200, link, xlarge
worker-25, 0.000, 2.500, kernel-A, xlarge
worker-25, 3.000, 0.050, sync, medium
worker-25, 3.150, 1.000, parse, medium
worker-25, 3.850, 0.500, sort, medium
worker-25, 4.850, 5.000, write, large
worker-25, 10.350, 5.000, alloc, medium
worker-25, 15.850, 8.000, free, large
worker-25, 23.850, 0.200, merge, small
worker-25, 24.550, 2.500, kernel-B, large
worker-25, 26.750, 1.000, sort, large
worker-26, 0.100, 2.500, checkpoint, small
worker-26, 2.700, 0.000, write, xlarge
worker-26, 3.200, 1.000, read, large
worker-26, 3.900, 8.000, link, tiny
worker-26, 11.900, 2.500, flush, small
worker-26, 14.100, 5.000, recv, medium
worker-26, 19.600, 2.500, flush, tiny
worker-26, 22.100, 8.000, free, medium
worker-26, 30.200, 8.000, compute, xlarge
worker-26, 37.900, 0.200, flush, medium
io-thread-27, 0.000, 0.005, compile, tiny
io-thread-27, 0.000, 5.000, fsync, medium
io-thread-27, 4.700, 0.000, ping, tiny
io-thread-27, 4.700, 1.000, alloc, large
io-thread-27, 5.700, 0.200, parse, large
io-thread-27, 6.400, 0.050, fsync, small
io-thread-27, 6.150, 2.500, poll, small
io-thread-27, 8.750, 0.050, kernel-B, large
io-thread-27, 8.800, 5.000, recv, tiny
io-thread-27, 13.900, 0.500, checkpoint, xlarge
worker-28, 0.000, 0.005, link, medium
worker-28, 0.505, 0.500, flush, large
worker-28, 1.005, 5.000, send, small
worker-28, 6.105, 5.000, read, small
worker-28, 11.205, 1.000, dispatch, medium
worker-28, 12.205, 0.000, checkpoint, large
worker-28, 12.205, 0.000, dispatch, tiny
worker-28, 12.705, 5.000, send, small
worker-28, 18.205, 1.000, kernel-B, small
worker-28, 19.705, 0.500, checkpoint, small
worker-29, 0.000, 0.000, send, large
worker-29, 0.000, 1.000, sort, small
worker-29, 0.700, 0.500, ping, large
worker-29, 1.200, 0.200, write, xlarge
worker-29, 1.400, 8.000, parse, medium
worker-29, 9.400, 0.500, optimize, medium
worker-29, 9.900, 0.005, link, tiny
worker-29, 9.905, 0.200, checkpoint, large
worker-29, 10.605, 1.000, sync, large
worker-29, 11.305, 0.500, serialize, tiny
io-thread-30, 0.100, 1.000, checkpoint, medium
io-thread-30, 1.600, 2.500, flush, medium
io-thread-30, 3.800, 0.200, optimize, tiny
io-thread-30, 4.500, 8.000, ping, xlarge
io-thread-30, 12.500, 0.005, flush, large
io-thread-30, 12.505, 2.500, read, small
io-thread-30, 14.705, 0.000, send, large
io-thread-30, 14.405, 0.005, kernel-B, xlarge
io-thread-30, 14.410, 2.500, link, medium
io-thread-30, 17.410, 2.500, dispatch, small
worker-31, 0.100, 0.005, optimize, xlarge
worker-31, 0.205, 0.500, compute, medium
worker-31, 0.705, 5.000, link, small
worker-31, 5.705, 0.005, checkpoint, medium
worker-31, 6.210, 1.000, compute, large
worker-31, 7.210, 0.200, read, large
worker-31, 7.110, 0.200, flush, xlarge
worker-31, 7.010, 0.000, ping, small
worker-31, 7.010, 0.200, sync, xlarge
worker-31, 7.210, 0.200, kernel-B, medium
Loading