mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-16 03:49:52 +00:00
refactor: extract getting report for benchmarking
This commit is contained in:
@@ -71,11 +71,16 @@ func BenchmarkReportMerge(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func benchmarkRender(b *testing.B, f func(report.Report)) {
|
||||
func getReport(b *testing.B) report.Report {
|
||||
r := fixture.Report
|
||||
if *benchReportPath != "" {
|
||||
r = NewSmartMerger().Merge(upgradeReports(readReportFiles(b, *benchReportPath)))
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func benchmarkRender(b *testing.B, f func(report.Report)) {
|
||||
r := getReport(b)
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
b.StopTimer()
|
||||
|
||||
Reference in New Issue
Block a user