ordo-one / package-benchmark

Swift benchmark runner with many performance metrics and great CI support
Apache License 2.0
326 stars 25 forks source link

feat(minor): Exporter specific configurations #286

Open CrownedPhoenix opened 1 month ago

CrownedPhoenix commented 1 month ago

Description

A series of refactors that culminate in enabling exporter specific configurations to be provided at benchmark initialization.

This is intended to support a use case like the following.

for n in [10, 100, 1000] {
    let x = Double.random(in: 0.0...100.0)
    Benchmark("Foo", configuration: .init(
        tags: ["n": String(n), "x": String(x)],
        exportConfigurations: [
            .influx: InfluxExportConfiguration(
                fields: ["x": .double]
            )
        ]
    )) { _ in
        foo(n, x)
    }
}

This PR is more easily reviewed by commit.

How Has This Been Tested?

I manually tested the exporter csv against an instance of Influx using Influx Data Explorer and querying a raw csv. I followed instructions listed here

Minimal checklist:

CrownedPhoenix commented 1 month ago

Would like some feedback on how/whether we'd prefer to do unit and/or integration tests for this feature.