-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_records.yml
69 lines (64 loc) · 1.76 KB
/
get_records.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
requires:
stack: true
serverless: false
---
setup:
- do:
ml.put_job:
job_id: jobs-get-result-records
body: >
{
"analysis_config" : {
"detectors" :[{"function":"metric","field_name":"responsetime","by_field_name":"airline"}]
},
"data_description" : {
"format":"xcontent",
"time_field":"time"
}
}
- do:
index:
index: .ml-anomalies-jobs-get-result-records
id: jobs-get-result-records_1464739200000_1_1
body:
{
"job_id": "jobs-get-result-records",
"result_type": "record",
"timestamp": "2016-06-01T00:00:00Z",
"record_score": 60.0,
"bucket_span": 1
}
- do:
index:
index: .ml-anomalies-jobs-get-result-records
id: jobs-get-result-records_1464825600000_1_2
body:
{
"job_id": "jobs-get-result-records",
"result_type": "record",
"timestamp": "2016-06-02T00:00:00Z",
"record_score": 80.0,
"bucket_span": 1,
"is_interim": true
}
- do:
indices.refresh:
index: .ml-anomalies-jobs-get-result-records
---
teardown:
- do:
ml.delete_job:
job_id: jobs-get-result-records
---
"ml.get_records":
- do:
ml.get_records:
job_id: "jobs-get-result-records"
- match: { count: 2 }
- match: { records.0.timestamp: 1464825600000 }
- match: { records.0.job_id: jobs-get-result-records}
- match: { records.0.result_type: record}
- match: { records.1.timestamp: 1464739200000 }
- match: { records.1.job_id: jobs-get-result-records}
- match: { records.1.result_type: record}