Skip to content

Commit

Permalink
fix count plot
Browse files Browse the repository at this point in the history
  • Loading branch information
Quafadas committed Nov 15, 2024
1 parent fbf5e73 commit 735cf69
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions jsSite/src/BenchmarkPlots.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ object BenchmarkPlots:
) ++
(vconcat =
List(
BenchmarkPlotElements.layer(10),
BenchmarkPlotElements.layer(1000),
BenchmarkPlotElements.layer(100000)
BenchmarkPlotElements.layer(10, "n"),
BenchmarkPlotElements.layer(1000, "n"),
BenchmarkPlotElements.layer(100000, "n")
)
)
write(thePlot)
end addScalarBenchmark

def addScalarBenchmarkOverTime: String =
val thePlot = BenchmarkPlotElements.schema ++
// BenchmarkPlotElements.data("../../benchmarks/benchmark_history.json") ++
BenchmarkPlotElements.fakeData ++
BenchmarkPlotElements.data("../../benchmarks/benchmark_history.json") ++
// BenchmarkPlotElements.fakeData ++
(transform = BenchmarkPlotElements.timeTransform(List("AddScalarBenchmark.vecxt_add_vec"))) ++
(vconcat =
List(
BenchmarkPlotElements.timeLayer(10),
BenchmarkPlotElements.timeLayer(1000),
BenchmarkPlotElements.timeLayer(100000)
BenchmarkPlotElements.timeLayer(10, "n"),
BenchmarkPlotElements.timeLayer(1000, "n"),
BenchmarkPlotElements.timeLayer(100000, "n")
)
)
write(thePlot)
Expand All @@ -48,9 +48,9 @@ object BenchmarkPlots:
) ++
(vconcat =
List(
BenchmarkPlotElements.layer(3),
BenchmarkPlotElements.layer(128),
BenchmarkPlotElements.layer(100000)
BenchmarkPlotElements.layer(3, "len"),
BenchmarkPlotElements.layer(128, "len"),
BenchmarkPlotElements.layer(100000, "len")
)
)
write(thePlot)
Expand Down
8 changes: 4 additions & 4 deletions jsSite/src/PlotElements.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ object BenchmarkPlotElements:
)
*: windowAndSortAndFilterLatest

def timeLayer(n: Int) = (
def timeLayer(n: Int, benchmarkVariableName: String) = (
layer = Tuple2(
(
title = s"n = $n",
Expand Down Expand Up @@ -146,11 +146,11 @@ object BenchmarkPlotElements:
)
),
transform = List(
(filter = s"(datum.params.n == '$n')")
(filter = s"(datum.params.$benchmarkVariableName == '$n')")
)
)

def layer(n: Int, yZeroScale: Boolean = false) =
def layer(n: Int, benchmarkVariableName: String, yZeroScale: Boolean = false) =

val yScale = (
field = "benchmark",
Expand Down Expand Up @@ -199,7 +199,7 @@ object BenchmarkPlotElements:
)
),
transform = List(
(filter = s"(datum.params.n == '$n')")
(filter = s"(datum.params.$benchmarkVariableName == '$n')")
)
)
end layer
Expand Down
8 changes: 4 additions & 4 deletions jsSite/test/src/plotChecks.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ end Process

class PlotChecks extends munit.FunSuite:

// test("some test data") {
// val argy = Fake.fakeData.arr.filter(d => d("benchmark").str.contains("AddScalarBenchmark.vecxt_add_vec"))
// println(argy)
test("some test data") {
val argy = Fake.fakeData.arr.filter(d => d("benchmark").str.contains("CountTrueBenchmark"))
println(argy)

// }
}

test("Add scalar plot") {
assertEquals(
Expand Down

0 comments on commit 735cf69

Please sign in to comment.