author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sun, 23 Jun 2013 21:09:43 +0100 | |
changeset 96 | b3e57ae92f7f |
parent 90 | af50db15da25 |
child 122 | 9ad7296fc59a |
permissions | -rw-r--r-- |
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'jv:calipel/s' }" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
BenchmarkReport subclass:#BenchmarkReportJSON |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
instanceVariableNames:'json' |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
classVariableNames:'' |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
poolDictionaries:'' |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
category:'CalipeL-S-Core-Reports' |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
!BenchmarkReportJSON methodsFor:'accessing'! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
stream:something |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
stream := something. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
json := BenchmarkReportJSONWriter on: stream. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
"Created: / 12-06-2013 / 14:22:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
! ! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
!BenchmarkReportJSON methodsFor:'writing'! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
write |
89
b37be3ddfeed
Added timestamp to BenchmarkResult.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
23 |
json writeDictionaryWith:[ |
b37be3ddfeed
Added timestamp to BenchmarkResult.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
24 |
json writeKey: 'timestamp' value: result timestamp printISO8601. |
b37be3ddfeed
Added timestamp to BenchmarkResult.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
25 |
json writeElementSeparator. |
88
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
26 |
json writeKey: 'configuration' valueWith: [ self writeConfiguration ]. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
27 |
json writeElementSeparator. |
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
json writeKey: 'outcomes' valueWith: [ self writeOutcomes ] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
]. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
"Created: / 12-06-2013 / 14:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
89
b37be3ddfeed
Added timestamp to BenchmarkResult.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
88
diff
changeset
|
32 |
"Modified: / 23-06-2013 / 00:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
33 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
writeBenchmark: benchmark |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
json writeDictionaryWith:[ |
90
af50db15da25
Added name, id and description to benchmark annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
37 |
json writeKey: 'name' value: benchmark name. |
af50db15da25
Added name, id and description to benchmark annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
38 |
json writeElementSeparator. |
af50db15da25
Added name, id and description to benchmark annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
39 |
json writeKey: 'description' value: benchmark description. |
af50db15da25
Added name, id and description to benchmark annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
40 |
json writeElementSeparator. |
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
json writeKey: 'class' value: benchmark instance class name. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
42 |
json writeElementSeparator. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
43 |
json writeKey: 'selector' value: benchmark selector. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
44 |
] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
45 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
"Created: / 12-06-2013 / 14:10:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
90
af50db15da25
Added name, id and description to benchmark annotation.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
89
diff
changeset
|
47 |
"Modified: / 23-06-2013 / 02:27:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
|
88
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
50 |
writeConfiguration |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
51 |
json writeDictionaryWith: [ |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
52 |
json writeKey: 'language' value: 'Smalltalk'. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
53 |
json writeElementSeparator. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
54 |
json writeKey: 'runtime' value: BenchmarkPlatform current configurationStringRuntime. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
55 |
json writeElementSeparator. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
56 |
json writeKey: 'os' value: BenchmarkPlatform current configurationStringOS |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
57 |
]. |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
58 |
|
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
59 |
"Created: / 22-06-2013 / 22:43:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
60 |
! |
7939ec1b572b
Added configuration identification into JSON report (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
29
diff
changeset
|
61 |
|
29
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
writeFooter |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
"superclass BenchmarkReport says that I am responsible to implement this method" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
"Modified: / 12-06-2013 / 14:14:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
66 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
writeHeader |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
"superclass BenchmarkReport says that I am responsible to implement this method" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
71 |
"Modified: / 12-06-2013 / 14:14:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
writeOutcome:outcome |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
json writeDictionaryWith:[ |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
json writeKey: 'benchmark' valueWith: [ self writeBenchmark: outcome benchmark ]. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
77 |
json writeElementSeparator. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
78 |
json writeKey: 'times' value: outcome times. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
json writeElementSeparator. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
80 |
json writeKey: 'parameters' valueWith: [ self writeParameters: outcome ]. |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
81 |
] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
82 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
"Modified: / 12-06-2013 / 14:10:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
86 |
writeOutcomes |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
87 |
"raise an error: must be redefined in concrete subclass(es)" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
88 |
json writeArrayWith:[ |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
89 |
result |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
90 |
outcomesDo: [:outcome| self writeOutcome: outcome] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
91 |
separatedBy:[json writeElementSeparator] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
"Created: / 11-06-2013 / 23:39:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
95 |
"Modified (format): / 12-06-2013 / 14:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
96 |
! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
97 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
98 |
writeParameters: outcome |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
99 |
json writeDictionaryWith: [] |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
"Created: / 12-06-2013 / 14:10:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
! ! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
!BenchmarkReportJSON class methodsFor:'documentation'! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
105 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
106 |
version_HG |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
|
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
108 |
^ '$Changeset: <not expanded> $' |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
109 |
! ! |
00d2eaa41853
Initial version of JSON report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
110 |