s/BenchmarkReport.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 12 Aug 2013 18:26:45 +0100
changeset 180 df8e7dcbfd8d
parent 122 9ad7296fc59a
child 189 89dc47e75645
child 190 ab1b88f52b93
permissions -rw-r--r--
Removed --machineid and added --name parameter to identify benchmark run. The specified name is then written in the report under key "name".

"{ Package: 'jv:calipel/s' }"

Object subclass:#BenchmarkReport
	instanceVariableNames:'stream result name'
	classVariableNames:''
	poolDictionaries:''
	category:'CalipeL-S-Core-Reports'
!


!BenchmarkReport class methodsFor:'instance creation'!

json
    ^BenchmarkReportJSON new

    "Created: / 12-06-2013 / 14:13:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

text
    ^BenchmarkReportText new

    "Created: / 28-05-2013 / 00:59:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-05-2013 / 11:03:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BenchmarkReport class methodsFor:'testing'!

isAbstract
    ^self == BenchmarkReport

    "Created: / 28-05-2013 / 00:32:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BenchmarkReport methodsFor:'accessing'!

name
    ^ name ? '<unnamed>'

    "Modified: / 12-08-2013 / 18:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

name:aString
    name := aString.
!

result
    ^ result
!

result:something
    result := something.
!

stream
    ^ stream
!

stream:something
    stream := something.
! !

!BenchmarkReport methodsFor:'writing'!

write
    self 
        writeHeader;
        writeOutcomes;
        writeFooter.

    "Created: / 28-05-2013 / 00:34:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 11-06-2013 / 23:26:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

write: aBenchmarkResult on: aStream
    self stream: aStream.
    self result: aBenchmarkResult.
    self write.

    "Created: / 28-05-2013 / 00:33:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

writeFooter
    self subclassResponsibility

    "Created: / 11-06-2013 / 23:26:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

writeHeader
    self subclassResponsibility

    "Created: / 11-06-2013 / 23:26:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

writeOutcome:arg
    "raise an error: must be redefined in concrete subclass(es)"

    ^ self subclassResponsibility
!

writeOutcomes
    result outcomesDo:[:outcome | self writeOutcome: outcome ].

    "Created: / 11-06-2013 / 23:26:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BenchmarkReport class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_MC
    ^ 'CalipeL_S-Core-JanVrany.7 5c300a20-c9d7-11e2-a959-606720e43e2c 2013-05-31T10:49:17 JanVrany'
! !