Skip to content

Commit

Permalink
Update packages/SwingSet/misc-tools/block-times.py
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Gibson <[email protected]>
  • Loading branch information
warner and gibson042 authored Oct 5, 2024
1 parent c4872b1 commit fe12fee
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/SwingSet/misc-tools/block-times.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#
# given a slogfile on stdin, emit a CSV of (blockHeight, start,
# elapsed) that measures the swingset time for each block (from
# cosmic-swingset-end-block-start to
# cosmic-swingset-end-block-finish), suitable for pasting into a
# spreadsheet to make a graph
# Given a slogfile on stdin, emit a CSV for every end-block:
# height,start,lag,swingset,deliveries,computrons,bridge_inbounds,consensus_time,block_time
# "lag" is the duration between begin-block `blockTime` and `time`, "swingset"
# is the duration of end-block, "deliveries" and "computrons" and
# "bridge_inbounds" are counts, "consensus_time" is the duration from
# after-commit-block to the next begin-block, "block_time" is the duration
# between consecutive begin-blocks, and all durations are in seconds.

import sys, json, statistics

print("height,start,lag,swingset,deliveries,computrons,bridge_inbounds,consensus_time,block_time")
# consensus_time is from cosmic-swingset-after-commit-block to cosmic-swingset-begin-block
# block_time is from cosmic-swingset-end-block-start to cosmic-swingset-end-block-start

lag = None # time - blockTime, how far was the node behind
start = None # latest cosmic-swingset-end-block-start time
Expand Down

0 comments on commit fe12fee

Please sign in to comment.