lue-bird / elm-alternative-benchmark-runner / Benchmark.Status.Alternative

Alternative way of representing the status of a benchmark.

fromReport : Benchmark.Reporting.Report -> Status

Convert a Benchmark.Reporting.Report to a Benchmark.Status.Alternative.Status.


type Status
    = Running Running (Structure {})
    | Finished (Structure { result : Result })

State of a benchmark: Finished or still Running.

when Running


type Running
    = WarmingJit
    | FindingSampleSize
    | CollectingSamples Basics.Float

Status of a running benchmark.

when Finished


type alias Result =
Result Benchmark.Status.Error (Trend.Linear.Trend Trend.Linear.Quick)

Information about a finished benchmark.

utils

runsPerSecond : Trend.Linear.Trend a_ -> Basics.Float

Predict the amount of runs / 1 second.

results : Structure { result : Result } -> List Result

Collect all results.

lowestGoodnessOfFit =
    results
        >> List.filterMap Result.toMaybe
        >> List.map Trend.goodnessOfFit
        >> List.minimum
        >> Maybe.withDefault 1

errors =
    results
        >> List.filterMap
            (\result ->
                case result of
                    Err err ->
                        Just err

                    Ok _ ->
                        Nothing
            )

structure


type alias Structure status =
{ name : String
, structureKind : StructureKind status 
}

The name and structure of a specific Benchmark.


type StructureKind status
    = Single status
    | Group (List (Structure status))
    | Series (List { status | name : String })

The structure type of a specific Benchmark.