Skip to content

Commit c02f10a

Browse files
authored
feat(ui): show gas used next to MGas/s in test detail executions (#171)
## Summary - Displays gas used (in millions) alongside the MGas/s value for newPayload requests in the test details modal executions list - Shows as e.g. `123.45 MGas/s (21.00M gas)` — only renders when both values are present ## Test plan - [x] Open a run detail page, click a test to open the modal - [x] Verify newPayload execution rows show gas used next to MGas/s - [x] Verify non-newPayload rows (without MGas/s) are unaffected
1 parent 0ced043 commit c02f10a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ui/src/components/run-detail/ExecutionsList.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ interface ExecutionRowProps {
9191
time?: number
9292
status?: number // 0=success, 1=fail
9393
mgasPerSec?: number
94+
gasUsed?: number
9495
}
9596

9697
function StatusIndicator({ status }: { status?: number }) {
@@ -112,7 +113,7 @@ function StatusIndicator({ status }: { status?: number }) {
112113
)
113114
}
114115

115-
function ExecutionRow({ index, request, response, time, status, mgasPerSec }: ExecutionRowProps) {
116+
function ExecutionRow({ index, request, response, time, status, mgasPerSec, gasUsed }: ExecutionRowProps) {
116117
const [expanded, setExpanded] = useState(false)
117118
const method = parseMethod(request)
118119

@@ -131,6 +132,11 @@ function ExecutionRow({ index, request, response, time, status, mgasPerSec }: Ex
131132
{mgasPerSec !== undefined && (
132133
<span className="shrink-0 text-sm/6 font-medium text-blue-600 dark:text-blue-400">
133134
{mgasPerSec.toFixed(2)} MGas/s
135+
{gasUsed !== undefined && (
136+
<span className="ml-1 font-normal text-gray-500 dark:text-gray-400">
137+
({(gasUsed / 1e6).toFixed(2)}M gas)
138+
</span>
139+
)}
134140
</span>
135141
)}
136142
{time !== undefined && (
@@ -210,6 +216,7 @@ export function ExecutionsList({ runId, suiteHash, testName, stepType }: Executi
210216
time={resultDetails?.duration_ns[index]}
211217
status={resultDetails?.status[index]}
212218
mgasPerSec={resultDetails?.mgas_s[String(index)]}
219+
gasUsed={resultDetails?.gas_used[String(index)]}
213220
/>
214221
))}
215222
</div>

0 commit comments

Comments
 (0)