Skip to content

Commit

Permalink
Adding machine hostname report
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Dec 18, 2024
1 parent 8c241a3 commit b3aa122
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/BlocBenchs-Core/BlBResult.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,23 @@ BlBResult >> shortBlocToploVersion [
| versions toploCommit blocCommit |

versions := (content at: #repositoriesVersions) second.
toploCommit := versions detect: [ :e | e first sameAs: 'toplo' ] ifFound: [ :e | e third ].
blocCommit := versions detect: [ :e | e first sameAs: 'bloc' ] ifFound: [ :e | e third ].
toploCommit := (versions detect: [ :e | e first sameAs: 'toplo' ]) third first: 8.
blocCommit := (versions detect: [ :e | e first sameAs: 'bloc' ]) third first: 8.

^ 'T{1}-B{2}' format: { toploCommit. blocCommit }
]

{ #category : #accessing }
BlBResult >> shortImageVersion [

| fullImageVersion parts |
| fullImageVersion matcher |
fullImageVersion := self imageVersion.

parts := (fullImageVersion allButFirst: 'Pharo-' size) splitOn: [ :e |
#( $. $+ ) includes: e ].

^ '{1}.{2}.{3}-{6}' format: parts.
matcher := '.*-(\d+\.\d+.\d+).*build\.(\d+)\..*' asRegex.
(matcher matches: fullImageVersion)
ifFalse: [ self error: 'Cannot parse imageVersion' ].

^ '{1}-{2}' format: {matcher subexpression: 2. matcher subexpression: 3}.

]

Expand Down
7 changes: 6 additions & 1 deletion src/BlocBenchs-Core/BlBVersionsMeter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ BlBVersionsMeter >> reportResultsFrom: aBlBBlocBenchRunner in: aBlBResult [
aBlBResult
addField: #osVersion
title: 'Operating System Version'
value: self osVersion.
value: self osVersion.

aBlBResult
addField: #hostname
title: 'Hostname'
value: NetNameResolver localHostName
]

{ #category : #accessing }
Expand Down

0 comments on commit b3aa122

Please sign in to comment.