render

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package render generates HTML and JSON reports from test execution results.

This package transforms RunResult data into formatted reports with:

  • Provider × Region performance matrices
  • Token usage and cost breakdowns
  • Average latency calculations
  • Success/error rate summaries
  • Markdown-formatted conversation logs

Reports can be generated as standalone HTML files or JSON data exports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHTMLReport

func GenerateHTMLReport(results []engine.RunResult, outputPath string) error

GenerateHTMLReport creates an HTML report from run results

Types

type HTMLReportData

type HTMLReportData struct {
	Title          string             `json:"title"`
	GeneratedAt    time.Time          `json:"generated_at"`
	Summary        ReportSummary      `json:"summary"`
	Results        []engine.RunResult `json:"results"`
	Providers      []string           `json:"providers"`
	Regions        []string           `json:"regions"`
	Scenarios      []string           `json:"scenarios"`
	Matrix         [][]MatrixCell     `json:"matrix"` // Deprecated: kept for backwards compatibility
	ScenarioGroups []ScenarioGroup    `json:"scenario_groups"`
}

HTMLReportData contains all data needed for the HTML report

type MatrixCell

type MatrixCell struct {
	Provider   string  `json:"provider"`
	Region     string  `json:"region"`
	Scenarios  int     `json:"scenarios"`
	Successful int     `json:"successful"`
	Errors     int     `json:"errors"`
	Cost       float64 `json:"cost"`
}

MatrixCell represents a cell in the provider x region matrix

type MediaStats added in v1.1.0

type MediaStats struct {
	TotalImages      int
	TotalAudio       int
	TotalVideo       int
	MediaLoadSuccess int
	MediaLoadErrors  int
	TotalMediaSize   int64
}

MediaStats holds aggregate media statistics across multiple run results.

type ReportSummary

type ReportSummary struct {
	TotalRuns      int     `json:"total_runs"`
	SuccessfulRuns int     `json:"successful_runs"`
	ErrorRuns      int     `json:"error_runs"`
	TotalCost      float64 `json:"total_cost"`
	TotalTokens    int     `json:"total_tokens"`
	AvgLatency     string  `json:"avg_latency"`
	// Media statistics
	TotalImages      int   `json:"total_images"`
	TotalAudio       int   `json:"total_audio"`
	TotalVideo       int   `json:"total_video"`
	MediaLoadSuccess int   `json:"media_load_success"`
	MediaLoadErrors  int   `json:"media_load_errors"`
	TotalMediaSize   int64 `json:"total_media_size_bytes"`
}

ReportSummary contains aggregate statistics

type ScenarioGroup

type ScenarioGroup struct {
	ScenarioID string             `json:"scenario_id"`
	Providers  []string           `json:"providers"`
	Regions    []string           `json:"regions"`
	Matrix     [][]MatrixCell     `json:"matrix"`
	Results    []engine.RunResult `json:"results"`
}

ScenarioGroup represents a scenario with its provider×region matrix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL