@@ -111,11 +111,12 @@ module Benchmarker =
111
111
member val Statistics = statistics with get, set
112
112
member val Memory = memory with get, set
113
113
114
- type BenchmarkReport ( title : string , totalTime : TimeSpan , date : DateTime , commit : string , host : HostEnvironmentInfo , benchmarks : Benchmark list ) =
114
+ type BenchmarkReport ( title : string , totalTime : TimeSpan , date : DateTime , commit : string , branchName : string , host : HostEnvironmentInfo , benchmarks : Benchmark list ) =
115
115
member val Title = title with get, set
116
116
member val TotalTime = totalTime with get, set
117
117
member val Date = date with get, set
118
118
member val Commit = commit with get, set
119
+ member val BranchName = branchName with get, set
119
120
member val HostEnvironmentInfo = host with get, set
120
121
member val Benchmarks = benchmarks with get, set
121
122
@@ -150,13 +151,14 @@ module Benchmarker =
150
151
for file in benchmarkOutputFiles do copyToOutput file
151
152
DeleteFiles benchmarkOutputFiles
152
153
153
- let IndexResult ( client : ElasticClient , file : string , date : DateTime , commit : string , indexName , typeName ) =
154
+ let IndexResult ( client : ElasticClient , file : string , date : DateTime , commit : string , branchName : string , indexName , typeName ) =
154
155
155
156
trace ( sprintf " Indexing report %s into Elasticsearch" file)
156
157
157
158
let document = JsonConvert.DeserializeObject< BenchmarkReport>( File.ReadAllText( file))
158
159
document.Date <- date
159
160
document.Commit <- commit
161
+ document.BranchName <- branchName
160
162
161
163
let indexRequest = new IndexRequest< BenchmarkReport>( indexName, typeName)
162
164
indexRequest.Document <- document
@@ -173,6 +175,7 @@ module Benchmarker =
173
175
174
176
let date = DateTime.UtcNow
175
177
let commit = getSHA1 " ." " HEAD"
178
+ let branchName = getBranchName " ."
176
179
177
180
let benchmarkJsonFiles =
178
181
Directory.EnumerateFiles( benchmarkOutput.FullName, " *-custom.json" , SearchOption.AllDirectories)
@@ -238,6 +241,6 @@ module Benchmarker =
238
241
raise ( Exception( " Unable to create pipeline" ))
239
242
240
243
for file in benchmarkJsonFiles
241
- do IndexResult ( client, file, date, commit, indexName, typeName)
244
+ do IndexResult ( client, file, date, commit, branchName , indexName, typeName)
242
245
243
246
trace " Indexed benchmark reports into Elasticsearch"
0 commit comments