Skip to content

Commit c1e01df

Browse files
committed
Connect CI-generated historic benchmark data in image
Usage: TDBBenchmarkRunner exploreHistoricTimesToRun
1 parent 49e6691 commit c1e01df

File tree

12 files changed

+116
-3
lines changed

12 files changed

+116
-3
lines changed

packages/BaselineOfTraceDebugger.package/BaselineOfTraceDebugger.class/instance/baseline..st

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ baseline: spec
1111
spec
1212
repository: 'github://LinqLover/SimulationStudio/packages';
1313
loads: #('SimulationStudio-Base' 'SimulationStudio-Support');
14-
flag: #(workaround moveUpstream) "we only need BlockClosure>>#valueAndStoreTimeToRun:. Contribute to Trunk and/or see https://github.com/LinqLover/SimulationStudio/issues/41"].
14+
flag: #(workaround moveUpstream) "we only need BlockClosure>>#valueAndStoreTimeToRun:. Contribute to Trunk and/or see https://github.com/LinqLover/SimulationStudio/issues/41"];
15+
baseline: 'StatisticsWorkbench' with: [
16+
spec
17+
repository: 'github://hpi-swa-teaching/StatisticsWorkbench:dev/packages'].
1518

1619
"packages"
1720
spec
@@ -20,7 +23,7 @@ baseline: spec
2023
package: 'TraceDebuggerTests' with: [
2124
spec requires: 'TraceDebugger'];
2225
package: 'TraceDebuggerBenchmarks' with: [
23-
spec requires: #('TraceDebugger' 'JSON')].
26+
spec requires: #('TraceDebugger' 'JSON' 'StatisticsWorkbench')].
2427

2528
"groups"
2629
spec

packages/BaselineOfTraceDebugger.package/BaselineOfTraceDebugger.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5-
"baseline:" : "ct 1/8/2022 20:11",
5+
"baseline:" : "ct 1/8/2022 23:05",
66
"projectClass" : "ct 3/5/2021 19:01" } }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
privateTimeToRun: aDuration
3+
4+
timeToRun := aDuration

packages/TraceDebuggerBenchmarks.package/TDBBenchmark.class/methodProperties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"preparationTime" : "ct 1/8/2022 19:08",
2323
"prepare:" : "ct 1/8/2022 14:12",
2424
"printOn:" : "ct 1/8/2022 15:44",
25+
"privateTimeToRun:" : "ct 1/8/2022 21:30",
2526
"run" : "ct 1/8/2022 14:25",
2627
"runWithoutTimeout" : "ct 1/8/2022 14:26",
2728
"selector" : "ct 1/8/2022 14:09",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
historic data
2+
benchmarksFromHistoricData: data
3+
4+
| benchmarks |
5+
benchmarks := Dictionary new.
6+
data do: [:entry |
7+
entry benches do: [:bench |
8+
benchmarks at: bench name put: bench benchmark]].
9+
^ benchmarks
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
historic data
2+
exploreHistoricTimesToRun
3+
"self exploreHistoricTimesToRun"
4+
5+
| datas diagram container |
6+
datas := self historicTimesToRun associations collect: [:benchmarkAndTimes |
7+
(SWDataLabeled
8+
fromXValues: (benchmarkAndTimes value keys "collect: #asUnixTime")
9+
versusYValues: (benchmarkAndTimes value values collect: #asMilliSeconds))
10+
dataName: benchmarkAndTimes key shortPrintString;
11+
dimensionNames: {"'Time'" 'Commit'. 'Milliseconds'};
12+
yourself].
13+
14+
diagram := SWDiagram new visualizeAll: datas with: SWScatterPlot.
15+
16+
container := Morph new
17+
color: Color white;
18+
extent: diagram fullBounds extent;
19+
yourself.
20+
container addMorph: diagram.
21+
diagram center: container center.
22+
^ container openInWindow
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
historic data
2+
historicData
3+
4+
| rawData |
5+
rawData := self historicRawData.
6+
self parseHistoricRawData: rawData.
7+
^ rawData entries Benchmark
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
historic data
2+
historicDataUrl
3+
4+
^ 'https://raw.githubusercontent.com/LinqLover/squeak-tracedebugger/gh-pages-benchmarks/dev/bench/data.js'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
historic data
2+
historicRawData
3+
4+
| jsonString regex request |
5+
request := WebClient httpGet: self historicDataUrl.
6+
request isSuccess ifFalse: [self error: request response].
7+
jsonString := nil.
8+
(regex := '^window\.BENCHMARK_DATA = (.*)$' asRegex)
9+
matchesIn: request content do: [:match |
10+
jsonString ifNotNil: [self error: 'Unexpected raw data format'].
11+
jsonString := (regex subexpression: 2) readStream].
12+
jsonString ifNil: [self error: 'Unexpected raw data format'].
13+
^ Json readFrom: jsonString readStream
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
historic data
2+
historicTimesToRun
3+
4+
| benchmarks data |
5+
data := self historicData.
6+
benchmarks := self benchmarksFromHistoricData: data.
7+
^ benchmarks values
8+
collect: [:benchmark |
9+
benchmark ->
10+
(data
11+
collect: [:entry |
12+
entry "date" index ->
13+
(entry benches
14+
detect: [:bench | bench benchmark shortPrintString = benchmark shortPrintString]
15+
ifFound: [:bench | bench benchmark timeToRun])]
16+
as: Dictionary)]
17+
as: Dictionary.

0 commit comments

Comments
 (0)