s/BenchmarkReport.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 13 Jul 2013 23:05:21 +0100
changeset 122 9ad7296fc59a
parent 29 00d2eaa41853
child 180 df8e7dcbfd8d
permissions -rw-r--r--
Added machine ID configuration value. Machine ID is used by CalipeL's web application identify a machine in a unique way. The machine ID can be supplied by a command line parameter --machineid. Default value is machine's hostname.

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

Object subclass:#BenchmarkReport
	instanceVariableNames:'stream result machineId'
	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'!

machineId
    machineId isNil ifTrue:[
        machineId := BenchmarkPlatform current configurationStringMachineId
    ].
    ^ machineId

    "Modified: / 13-07-2013 / 22:46:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

machineId:aString 
    machineId := 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'
! !