@@ -356,6 +356,7 @@ Base.show(io::IO, t::TrialJudgement) = _show(io, t)
356
356
357
357
function Base. show (io:: IO , :: MIME"text/plain" , t:: Trial )
358
358
pad = get (io, :pad , " " )
359
+ histnumber = get (io, :histnumber , " " ) # for Vector{Trial} printing
359
360
360
361
boxcolor = :light_black
361
362
boxspace = " "
@@ -382,10 +383,10 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
382
383
)
383
384
384
385
if length (t) == 0
385
- print (io, modulestr, " Trial: 0 samples" )
386
+ print (io, modulestr, " Trial$histnumber : 0 samples" )
386
387
return
387
388
elseif length (t) == 1
388
- printstyled (io, " ┌ " , modulestr, " Trial:\n " ; color= boxcolor)
389
+ printstyled (io, " ┌ " , modulestr, " Trial$histnumber :\n " ; color= boxcolor)
389
390
390
391
# Time
391
392
printstyled (io, pad, " │" , boxspace; color= boxcolor)
@@ -417,7 +418,7 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
417
418
418
419
# Main text block
419
420
420
- printstyled (io, " ┌ " , modulestr, " Trial:\n " ; color= boxcolor)
421
+ printstyled (io, " ┌ " , modulestr, " Trial$histnumber :\n " ; color= boxcolor)
421
422
422
423
printstyled (io, pad, " │" , boxspace; color= boxcolor)
423
424
printstyled (io, " min " ; color= :default )
@@ -558,6 +559,27 @@ function Base.show(io::IO, ::MIME"text/plain", t::Trial)
558
559
# printstyled(io, "●", color=:light_black) # other options "⋯" "¹⁰⁰"
559
560
end
560
561
562
+ function Base. show (io:: IO , m:: MIME"text/plain" , vt:: AbstractVector{<:Trial} )
563
+ bounds = map (vt) do t
564
+ # compute these exactly as in individual show methods:
565
+ mintime = minimum (t. times)
566
+ avgtime = mean (t. times)
567
+ quantime = quantile (t. times, 99 / 100 )
568
+ lo = hist_round_low (t. times, mintime, avgtime)
569
+ hi = hist_round_high (t. times, avgtime, quantime)
570
+ (lo, hi)
571
+ end
572
+ histmin = get (io, :histmin , minimum (first, bounds))
573
+ histmax = get (io, :histmax , maximum (last, bounds))
574
+ ioc = IOContext (io, :histmin => histmin, :histmax => histmax)
575
+
576
+ print (io, summary (vt), " :" )
577
+ for (i,t) in pairs (vt)
578
+ println (io)
579
+ show (IOContext (ioc, :histnumber => " [$i ]" ), m, t)
580
+ end
581
+ end
582
+
561
583
function Base. show (io:: IO , :: MIME"text/plain" , t:: TrialEstimate )
562
584
println (io, " BenchmarkTools.TrialEstimate: " )
563
585
pad = get (io, :pad , " " )
0 commit comments