@@ -25,6 +25,10 @@ open Git.Branches
25
25
26
26
module Benchmarker =
27
27
28
+ let pipelineName = " benchmark-pipeline"
29
+ let indexName = IndexName.op_ Implicit( " benchmark-reports" )
30
+ let typeName = TypeName.op_ Implicit( " report" )
31
+
28
32
type ProcessorName ( isValueCreated : bool , value : string ) =
29
33
member val IsValueCreated = isValueCreated with get, set
30
34
member val Value = value with get, set
@@ -123,7 +127,7 @@ module Benchmarker =
123
127
DotNetCli.RunCommand( fun p ->
124
128
{ p with
125
129
WorkingDir = testsProjectDirectory
126
- }) " run -f net46 -c Release Benchmark"
130
+ }) " run -f net46 -c Release -- Benchmark --namespace Tests "
127
131
finally
128
132
let benchmarkOutputFiles =
129
133
let output = combinePaths testsProjectDirectory " BenchmarkDotNet.Artifacts"
@@ -135,13 +139,15 @@ module Benchmarker =
135
139
136
140
let IndexResult ( client : ElasticClient , file : string , date : DateTime , commit : string , indexName , typeName ) =
137
141
142
+ trace ( " Indexing report " + file + " into Elasticsearch" )
143
+
138
144
let document = JsonConvert.DeserializeObject< Report>( File.ReadAllText( file))
139
145
document.Date <- date
140
146
document.Commit <- commit
141
147
142
148
let indexRequest = new IndexRequest< Report>( indexName, typeName)
143
149
indexRequest.Document <- document
144
- indexRequest.Pipeline <- " benchmark-pipeline "
150
+ indexRequest.Pipeline <- pipelineName
145
151
146
152
let indexResponse = client.Index( indexRequest)
147
153
@@ -162,8 +168,6 @@ module Benchmarker =
162
168
let uri = new Uri( url)
163
169
let client = new ElasticClient( uri)
164
170
165
- let indexName = IndexName.op_ Implicit( " reports" )
166
- let typeName = TypeName.op_ Implicit( " report" )
167
171
let indexExists = client.IndexExists( Indices.op_ Implicit( indexName)) .Exists
168
172
169
173
if indexExists = false then
@@ -183,18 +187,15 @@ module Benchmarker =
183
187
if createIndex.IsValid = false then
184
188
raise ( Exception( " Unable to create index into Elasticsearch" ))
185
189
186
- //let pipelineExists = client.GetPipeline(new GetPipelineRequest(Id.op_Implicit("benchmark-pipeline")))
187
-
188
- //if pipelineExists.IsValid = false then
189
- let forEachProcessor = new ForeachProcessor()
190
190
let processor = new GrokProcessor();
191
191
processor.Field <- new Field( " _ingest._value.displayInfo" )
192
192
processor.Patterns <- [ " %{WORD:_ingest._value.class}.%{WORD:_ingest._value.method}: Job-%{WORD:_ingest._value.jobName}\\ (Jit=%{WORD:_ingest._value.jit}, Runtime=%{WORD:_ingest._value.clr}, LaunchCount=%{NUMBER:_ingest._value.launchCount}, RunStrategy=%{WORD:_ingest._value.runStrategy}, TargetCount=%{NUMBER:_ingest._value.targetCount}, UnrollFactor=%{NUMBER:_ingest._value.unrollFactor}, WarmupCount=%{NUMBER:_ingest._value.warmupCount}\\ )" ]
193
-
193
+
194
+ let forEachProcessor = new ForeachProcessor()
194
195
forEachProcessor.Field <- new Field( " benchmarks" )
195
196
forEachProcessor.Processor <- processor
196
197
197
- let request = new PutPipelineRequest( Id.op_ Implicit( " benchmark-pipeline " ))
198
+ let request = new PutPipelineRequest( Id.op_ Implicit( pipelineName ))
198
199
request.Description <- " Grok benchmark settings"
199
200
request.Processors <- [ forEachProcessor]
200
201
0 commit comments