Skip to content

Commit

Permalink
[ML] Reordering aggregation options in wizards (#43445)
Browse files Browse the repository at this point in the history
* [ML] Reordering aggregation options in wizards

* fixing tests
  • Loading branch information
jgowdyelastic authored Aug 16, 2019
1 parent 5088548 commit ca393e6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class NewJobCapsService {
if (this._includeCountAgg === true) {
const { countField, countAggs } = createCountFieldAndAggs();

fields.push(countField);
fields.splice(0, 0, countField);
aggs.push(...countAggs);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"min": "avg"
},
"fieldIds": [
"DiskReadBytes",
"NetworkOut",
"CPUUtilization",
"NetworkIn"
"DiskReadBytes",
"NetworkIn",
"NetworkOut"
]
},
{
Expand All @@ -29,10 +29,10 @@
"min": "avg"
},
"fieldIds": [
"DiskReadBytes",
"NetworkOut",
"CPUUtilization",
"NetworkIn"
"DiskReadBytes",
"NetworkIn",
"NetworkOut"
]
},
{
Expand All @@ -46,10 +46,10 @@
"min": "avg"
},
"fieldIds": [
"DiskReadBytes",
"NetworkOut",
"CPUUtilization",
"NetworkIn"
"DiskReadBytes",
"NetworkIn",
"NetworkOut"
]
},
{
Expand Down Expand Up @@ -108,8 +108,8 @@
"min": "min"
},
"fieldIds": [
"NetworkOut",
"NetworkIn"
"NetworkIn",
"NetworkOut"
]
},
{
Expand All @@ -123,12 +123,24 @@
"min": "max"
},
"fieldIds": [
"DiskReadBytes",
"CPUUtilization"
"CPUUtilization",
"DiskReadBytes"
]
}
],
"fields": [
{
"id": "CPUUtilization",
"name": "CPUUtilization",
"type": "double",
"aggregatable": true,
"aggIds": [
"mean",
"high_mean",
"low_mean",
"max"
]
},
{
"id": "DiskReadBytes",
"name": "DiskReadBytes",
Expand Down Expand Up @@ -156,8 +168,8 @@
]
},
{
"id": "NetworkOut",
"name": "NetworkOut",
"id": "NetworkIn",
"name": "NetworkIn",
"type": "double",
"aggregatable": true,
"aggIds": [
Expand All @@ -168,20 +180,8 @@
]
},
{
"id": "CPUUtilization",
"name": "CPUUtilization",
"type": "double",
"aggregatable": true,
"aggIds": [
"mean",
"high_mean",
"low_mean",
"max"
]
},
{
"id": "NetworkIn",
"name": "NetworkIn",
"id": "NetworkOut",
"name": "NetworkOut",
"type": "double",
"aggregatable": true,
"aggIds": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@
}
],
"fields": [
{
"id": "airline",
"name": "airline",
"type": "keyword",
"aggregatable": true,
"aggIds": [
"distinct_count"
]
},
{
"id": "responsetime",
"name": "responsetime",
Expand All @@ -191,15 +200,6 @@
"max",
"distinct_count"
]
},
{
"id": "airline",
"name": "airline",
"type": "keyword",
"aggregatable": true,
"aggIds": [
"distinct_count"
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FieldsService {
}
});
}
return fields;
return fields.sort((a, b) => a.id.localeCompare(b.id));
}

// public function to load fields from _field_caps and create a list
Expand Down

0 comments on commit ca393e6

Please sign in to comment.