mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 22:07:44 +03:00
top: Don't crash on small terminals
Summary: `eden top` would previously crash if its terminal window was resized too small, due to incorrectly specifying a negative padding width in a format specifier. Reviewed By: xavierd Differential Revision: D44564714 fbshipit-source-id: 936f346ce7e7f5cb0f18cdbffa269cb0fd06be91
This commit is contained in:
parent
d8bd987a4d
commit
78031282c6
@ -708,7 +708,8 @@ class Top:
|
||||
requests_for_type = "N/A"
|
||||
elif requests_for_type == STATS_NOT_IMPLEMENTED:
|
||||
requests_for_type = ""
|
||||
requests_for_type_display = f"{requests_for_type:>{request_count_size-1}} "
|
||||
request_count_padding = max(request_count_size - 1, 0)
|
||||
requests_for_type_display = f"{requests_for_type:>{request_count_padding}} "
|
||||
|
||||
# duration of the longest request
|
||||
longest_request = metrics[RequestMetric.MAX_DURATION] # s
|
||||
|
Loading…
Reference in New Issue
Block a user