Skip to content
Merged
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
14 changes: 11 additions & 3 deletions report/src/pages/LoadTestDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ const SummarySection = ({ result }: { result: LoadTestResult }) => {
const submitted = result.throughput.total_submitted;
const confirmed = result.throughput.total_confirmed;
const failed = result.throughput.total_failed;
const blockRange = result.block_range;
const hasConfirmedBlockRange =
typeof blockRange?.first_block === "number" &&
typeof blockRange.last_block === "number";

return (
<StatCard title="Summary">
Expand Down Expand Up @@ -121,11 +125,15 @@ const SummarySection = ({ result }: { result: LoadTestResult }) => {
value={formatEthFromWei(result.gas.total_cost_wei)}
hint={`${result.gas.avg_gas_price.toLocaleString()} wei avg gas price`}
/>
{result.block_range && (
{blockRange && (
<Stat
label="Block range"
value={`${result.block_range.first_block.toLocaleString()} → ${result.block_range.last_block.toLocaleString()}`}
hint={`${result.block_range.block_count.toLocaleString()} blocks`}
value={
hasConfirmedBlockRange
? `${blockRange.first_block.toLocaleString()} → ${blockRange.last_block.toLocaleString()}`
: "No confirmed transactions"
}
hint={`${blockRange.block_count.toLocaleString()} blocks`}
/>
)}
</StatGrid>
Expand Down
5 changes: 3 additions & 2 deletions report/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ export interface ThroughputPercentiles {
}

export interface BlockRange {
first_block: number;
last_block: number;
// Omitted when no test transactions were confirmed.
first_block?: number;
last_block?: number;
block_count: number;
}

Expand Down
Loading