diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasCompletedOrTimedOut.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasCompletedOrTimedOut.st new file mode 100644 index 00000000..36a76f91 --- /dev/null +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasCompletedOrTimedOut.st @@ -0,0 +1,4 @@ +testing +hasCompletedOrTimedOut + + ^ result = #completed or: [result = #running] \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasRun.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasRun.st deleted file mode 100644 index 7d6bbf8c..00000000 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/hasRun.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -hasRun - - ^ hasRun \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/performBenchmark.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/performBenchmark.st index d0779e49..90d0c582 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/performBenchmark.st +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/instance/performBenchmark.st @@ -1,12 +1,14 @@ private performBenchmark - - hasRun := false. + + result := #running. totalTime := nil. preparationTime := Duration zero. postparationTime := Duration zero. - [self perform: selector. - hasRun := true] + [[self perform: selector. + result := #completed] valueAndStoreTimeToRunWithoutGC: [:duration | totalTime := duration. - timeToRun := totalTime - preparationTime - postparationTime]. \ No newline at end of file + timeToRun := totalTime - preparationTime - postparationTime]] + on: Error, Warning, Halt + do: [:ex | result := ex]. \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json index c3c06706..f9b53ef1 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json @@ -14,9 +14,9 @@ "instance" : { "debug" : "ct 1/8/2022 14:28", "defaultTimeout" : "ct 1/8/2022 18:42", - "hasRun" : "ct 1/8/2022 16:55", + "hasCompletedOrTimedOut" : "ct 1/9/2022 03:31", "method" : "ct 1/8/2022 15:58", - "performBenchmark" : "ct 1/8/2022 14:38", + "performBenchmark" : "ct 1/9/2022 17:49", "postparationTime" : "ct 1/8/2022 19:08", "postpare:" : "ct 1/8/2022 19:08", "preparationTime" : "ct 1/8/2022 19:08", diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/properties.json b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/properties.json index a842c9a1..0cf18a56 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/properties.json +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/properties.json @@ -9,7 +9,7 @@ "selector", "timeout", "wrappers", - "hasRun", + "result", "totalTime", "preparationTime", "postparationTime", diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/newDefault.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/newDefault.st new file mode 100644 index 00000000..c49f28d5 --- /dev/null +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/newDefault.st @@ -0,0 +1,4 @@ +instance creation +newDefault + + ^ self selector: self testSelector \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/runForVersionsHashes..st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/runForVersionsHashes..st new file mode 100644 index 00000000..18c1a498 --- /dev/null +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/class/runForVersionsHashes..st @@ -0,0 +1,18 @@ +bulk running +runForVersionsHashes: versionHashes + "Run all benchmarks for each of the specified version hashes (aka commit SHAs) and export the results for each version in a separate file. You may check in these results into the github-action-benchmark- database for GitHub pages by passing these files to the run_local.ts script, see: https://github.com/benchmark-action/github-action-benchmark/pull/99" + + | versions workingCopy | + workingCopy := (Smalltalk classNamed: #SquotWorkingCopy) registered + detect: [:ea | ea name = #TraceDebugger]. + versions := versionHashes collect: [:hash | workingCopy repository versionAt: hash]. + + Transcript openIfNone. + versions + do: [:version | | runner | + workingCopy loadVersion: version interactive: false. + runner := self newDefault + resultsFilePath: ('benchmark-results-{1}.json' format: {version hexHash}); + yourself. + Transcript showln: 'Runner result:'; show: runner run] + displayingProgress: [:version | 'Running benchmarks for {1}' format: {version}]. \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath..st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath..st new file mode 100644 index 00000000..71c1ac4f --- /dev/null +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath..st @@ -0,0 +1,4 @@ +accessing +resultsFilePath: aString + + resultsFilePath := aString \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath.st index 8a68aa86..8716c6db 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath.st +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/resultsFilePath.st @@ -1,4 +1,5 @@ accessing resultsFilePath - ^ self configAt: #TDBBenchmarkResultsPath ifAbsent: ['TDBBenchmarkResults.json'] \ No newline at end of file + ^ resultsFilePath ifNil: + [self configAt: #TDBBenchmarkResultsPath ifAbsent: ['TDBBenchmarkResults.json']] \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/test.st b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/test.st index e7076811..4fb1e4f7 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/test.st +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/instance/test.st @@ -6,6 +6,6 @@ test self exportResults. self - assert: (self benchmarks allSatisfy: [:bench | (results at: bench) allSatisfy: #hasRun]) + assert: (self benchmarks allSatisfy: [:bench | (results at: bench) allSatisfy: [:result | result hasCompletedOrTimedOut]]) description: ['Unsuccessful benchmarks: {1}' format: {self benchmarks - select: [:bench | (results at: bench) anySatisfy: [:ea | ea hasRun not]]}]. \ No newline at end of file + select: [:bench | (results at: bench) anySatisfy: [:ea | ea hasCompletedOrTimedOut not]]}]. \ No newline at end of file diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/methodProperties.json b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/methodProperties.json index 52d08c9c..a076d613 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/methodProperties.json +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/methodProperties.json @@ -6,9 +6,11 @@ "historicDataUrl" : "ct 1/8/2022 22:35", "historicRawData" : "ct 1/8/2022 22:41", "historicTimesToRun" : "ct 1/8/2022 22:55", + "newDefault" : "ct 1/9/2022 02:57", "parseHistoricBench:" : "ct 1/9/2022 02:11", "parseHistoricRawData:" : "ct 1/9/2022 01:52", "run" : "ct 1/8/2022 15:39", + "runForVersionsHashes:" : "ct 1/9/2022 17:57", "testSelector" : "ct 1/8/2022 15:38" }, "instance" : { "benchmarkClass" : "ct 1/8/2022 15:24", @@ -18,10 +20,11 @@ "getEnv:" : "ct 1/8/2022 15:31", "resultAsJson:" : "ct 1/9/2022 02:07", "resultsAsJson" : "ct 1/9/2022 01:57", - "resultsFilePath" : "ct 1/8/2022 15:41", + "resultsFilePath" : "ct 1/9/2022 02:57", + "resultsFilePath:" : "ct 1/9/2022 02:57", "runBenchmarks" : "ct 1/8/2022 18:50", "setUp" : "ct 1/8/2022 17:52", - "test" : "ct 1/8/2022 17:41", + "test" : "ct 1/9/2022 03:33", "timesToRepeat" : "ct 1/8/2022 17:30", "timesToRepeat:" : "ct 1/8/2022 17:30", "writeResults:toFile:" : "ct 1/8/2022 15:37" } } diff --git a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/properties.json b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/properties.json index c831f308..c05e9fcd 100644 --- a/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/properties.json +++ b/packages/TraceDebuggerBenchmarks.package/TDBBenchmarkRunner.class/properties.json @@ -8,7 +8,8 @@ "instvars" : [ "benchmarks", "results", - "timesToRepeat" ], + "timesToRepeat", + "resultsFilePath" ], "name" : "TDBBenchmarkRunner", "pools" : [ ],