@@ -8,6 +8,7 @@ type ReportOptions = {
88} ;
99
1010type BenchmarkResults = {
11+ status ?: string ;
1112 suite ?: string ;
1213 runs ?: Array < {
1314 metrics ?: {
@@ -17,6 +18,7 @@ type BenchmarkResults = {
1718 summary ?: {
1819 avgLatencyMs ?: number ;
1920 } ;
21+ warnings ?: string [ ] ;
2022} ;
2123
2224const toErrorMessage = ( error : unknown ) : string =>
@@ -105,24 +107,32 @@ export const registerReportCommand = (program: Command) => {
105107 . filter ( isFiniteNumber ) ;
106108 const avgLatency =
107109 latencies . length > 0
108- ? latencies . reduce ( ( sum , value ) => sum + value , 0 ) /
109- latencies . length
110+ ? latencies . reduce ( ( sum , value ) => sum + value , 0 ) / latencies . length
110111 : isFiniteNumber ( parsed . summary ?. avgLatencyMs )
111112 ? parsed . summary ?. avgLatencyMs
112113 : undefined ;
113114 const avgLatencyText =
114- typeof avgLatency === "number"
115- ? avgLatency . toFixed ( 2 )
116- : "N/A" ;
115+ typeof avgLatency === "number" ? avgLatency . toFixed ( 2 ) : "N/A" ;
116+
117+ const status = parsed . status ? parsed . status : "unknown" ;
118+ const warnings = Array . isArray ( parsed . warnings ) ? parsed . warnings : [ ] ;
117119
118120 const lines = [
119121 "# Benchmark Report" ,
120122 "" ,
123+ `- Status: ${ status } ` ,
121124 `- Suite: ${ suite } ` ,
122125 `- Runs: ${ runCount } ` ,
123126 `- Avg latency (ms): ${ avgLatencyText } ` ,
124127 "" ,
125- ] ;
128+ warnings . length > 0 ? "## Warnings" : "" ,
129+ ...warnings . map ( ( warning ) => `- ${ warning } ` ) ,
130+ warnings . length > 0 ? "" : "" ,
131+ "## Notes" ,
132+ "- If this report is marked as stub, replace placeholder metrics with real benchmark output." ,
133+ "- Re-run `dws benchmark --suite <name>` after integrating the DWS API." ,
134+ "" ,
135+ ] . filter ( ( line ) => line !== "" ) ;
126136
127137 await fs . writeFile ( resolvedOutput , lines . join ( "\n" ) , "utf8" ) ;
128138 console . log ( `Wrote report to ${ resolvedOutput } ` ) ;
0 commit comments