@@ -111,11 +111,12 @@ module Benchmarker =
111111 member val Statistics = statistics with get, set
112112 member val Memory = memory with get, set
113113
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 ) =
115115 member val Title = title with get, set
116116 member val TotalTime = totalTime with get, set
117117 member val Date = date with get, set
118118 member val Commit = commit with get, set
119+ member val BranchName = branchName with get, set
119120 member val HostEnvironmentInfo = host with get, set
120121 member val Benchmarks = benchmarks with get, set
121122
@@ -150,13 +151,14 @@ module Benchmarker =
150151 for file in benchmarkOutputFiles do copyToOutput file
151152 DeleteFiles benchmarkOutputFiles
152153
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 ) =
154155
155156 trace ( sprintf " Indexing report %s into Elasticsearch" file)
156157
157158 let document = JsonConvert.DeserializeObject< BenchmarkReport>( File.ReadAllText( file))
158159 document.Date <- date
159160 document.Commit <- commit
161+ document.BranchName <- branchName
160162
161163 let indexRequest = new IndexRequest< BenchmarkReport>( indexName, typeName)
162164 indexRequest.Document <- document
@@ -173,6 +175,7 @@ module Benchmarker =
173175
174176 let date = DateTime.UtcNow
175177 let commit = getSHA1 " ." " HEAD"
178+ let branchName = getBranchName " ."
176179
177180 let benchmarkJsonFiles =
178181 Directory.EnumerateFiles( benchmarkOutput.FullName, " *-custom.json" , SearchOption.AllDirectories)
@@ -238,6 +241,6 @@ module Benchmarker =
238241 raise ( Exception( " Unable to create pipeline" ))
239242
240243 for file in benchmarkJsonFiles
241- do IndexResult ( client, file, date, commit, indexName, typeName)
244+ do IndexResult ( client, file, date, commit, branchName , indexName, typeName)
242245
243246 trace " Indexed benchmark reports into Elasticsearch"
0 commit comments