MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / BuildBenchmarkReport

Method BuildBenchmarkReport

benchmark/core.go:180–225  ·  view source on GitHub ↗
(comparison *BenchmarkComparison, verdict BenchmarkVerdict, run BenchmarkRun, pluginRules map[string][]PluginSLA)

Source from the content-addressed store, hash-verified

178}
179
180func (BenchmarkCore) BuildBenchmarkReport(comparison *BenchmarkComparison, verdict BenchmarkVerdict, run BenchmarkRun, pluginRules map[string][]PluginSLA) BenchmarkReport {
181 if pluginRules == nil {
182 pluginRules = map[string][]PluginSLA{}
183 }
184 overview := buildOverviewLines(verdict, run, comparison)
185 var sections []PluginSection
186 for _, pluginName := range runPluginNames(run) {
187 result := run.PluginResults[pluginName]
188 deltaMetrics := map[string]any{}
189 if comparison != nil {
190 if found := comparison.MetricDeltas[pluginName]; found != nil {
191 deltaMetrics = found
192 }
193 }
194 failures := append([]FailureRecord{}, result.FailureRecords...)
195 for _, record := range verdict.FailureRecords {
196 if record.Plugin == pluginName {
197 failures = append(failures, record)
198 }
199 }
200 sections = append(sections, PluginSection{
201 Plugin: pluginName,
202 Scorecard: result.Scorecard,
203 ProcessMetrics: result.ProcessMetrics,
204 FailureRecords: failures,
205 SLARules: pluginRules[pluginName],
206 BenefitDirection: mapToBenefitLines(deltaMetrics),
207 })
208 }
209 notes := buildNoteLines(verdict, comparison)
210 markdown := renderMarkdown(overview, sections, verdict, notes)
211 var deltaRecords []MetricDelta
212 if comparison != nil {
213 deltaRecords = comparison.DeltaRecords
214 }
215 return BenchmarkReport{
216 Passed: verdict.Passed,
217 Markdown: markdown,
218 Overview: overview,
219 PluginSections: sections,
220 FailureRecords: verdict.FailureRecords,
221 Warnings: verdict.Warnings,
222 DeltaRecords: deltaRecords,
223 Notes: notes,
224 }
225}
226
227func satisfies(value any, operator string, threshold float64) (bool, error) {
228 numeric, ok := numericValue(value)

Callers 1

BuildBenchmarkReportFunction · 0.95

Calls 5

buildOverviewLinesFunction · 0.85
runPluginNamesFunction · 0.85
mapToBenefitLinesFunction · 0.85
buildNoteLinesFunction · 0.85
renderMarkdownFunction · 0.85

Tested by

no test coverage detected