Skip to content

Commit 9a4dd9f

Browse files
committed
Don't divide by zero
1 parent 319242d commit 9a4dd9f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deps/rabbit/src/rabbit_observer_cli_quorum_queues.erl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ ra_log_wal_sheet(RaCounters) ->
6161
#{content => {byte, maps:get(bytes_written, RaLogWalCounters)}, width => 15},
6262
#{content => maps:get(writes, RaLogWalCounters), width => 14},
6363
#{content => maps:get(batches, RaLogWalCounters), width => 13},
64-
#{content => {byte, maps:get(bytes_written, RaLogWalCounters) / maps:get(batches, RaLogWalCounters)}, width => 13},
65-
#{content => maps:get(writes, RaLogWalCounters) / maps:get(batches, RaLogWalCounters), width => 21}
64+
#{content => {byte, case maps:get(batches, RaLogWalCounters) of
65+
0 -> 0;
66+
Batches -> maps:get(bytes_written, RaLogWalCounters) / Batches
67+
end}, width => 13},
68+
#{content => case maps:get(batches, RaLogWalCounters) of
69+
0 -> 0;
70+
Batches -> maps:get(writes, RaLogWalCounters) / Batches
71+
end, width => 21}
6672
].
6773

6874
ra_log_segment_writer_header() ->

0 commit comments

Comments
 (0)