[DOCS] Compacted setup scripts in build.gradle (elastic/x-pack-elasticsearch#3573)
Original commit: elastic/x-pack-elasticsearch@9f3ef6af5c66447d14f2595a484754dc8f71dadd
@@ -254,41 +254,7 @@ setups['server_metrics_job'] = '''
}
}
'''
-setups['server_metrics_openjob'] = '''
- - do:
- indices.create:
- index: server-metrics
- body:
- settings:
- number_of_shards: 1
- number_of_replicas: 0
- mappings:
- metric:
- properties:
- timestamp:
- type: date
- total:
- type: long
- - do:
- xpack.ml.put_job:
- job_id: "total-requests"
- body: >
- {
- "description" : "Total sum of requests",
- "analysis_config" : {
- "bucket_span":"10m",
- "detectors" :[
- {
- "detector_description": "Sum of total",
- "function": "sum",
- "field_name": "total"
- }
- ]},
- "data_description" : {
- "time_field":"timestamp",
- "time_format": "epoch_ms"
- }
- }
+setups['server_metrics_openjob'] = setups['server_metrics_job'] + '''
- do:
xpack.ml.put_datafeed:
datafeed_id: "datafeed-total-requests"
@@ -302,54 +268,7 @@ setups['server_metrics_openjob'] = '''
xpack.ml.open_job:
job_id: "total-requests"
'''
-
-setups['server_metrics_startdf'] = '''
- - do:
- indices.create:
- index: server-metrics
- body:
- settings:
- number_of_shards: 1
- number_of_replicas: 0
- mappings:
- metric:
- properties:
- timestamp:
- type: date
- total:
- type: long
- - do:
- xpack.ml.put_job:
- job_id: "total-requests"
- body: >
- {
- "description" : "Total sum of requests",
- "analysis_config" : {
- "bucket_span":"10m",
- "detectors" :[
- {
- "detector_description": "Sum of total",
- "function": "sum",
- "field_name": "total"
- }
- ]},
- "data_description" : {
- "time_field":"timestamp",
- "time_format": "epoch_ms"
- }
- }
- - do:
- xpack.ml.put_datafeed:
- datafeed_id: "datafeed-total-requests"
- body: >
- {
- "job_id":"total-requests",
- "indexes":"server-metrics",
- "types":"metric"
- }
- - do:
- xpack.ml.open_job:
- job_id: "total-requests"
+setups['server_metrics_startdf'] = setups['server_metrics_openjob'] + '''
- do:
xpack.ml.start_datafeed:
datafeed_id: "datafeed-total-requests"
