Rename legacy and new metrics

This commit is contained in:
Ivana
2020-07-10 16:09:03 +02:00
parent 591d2b0e34
commit ae0681f54f
4 changed files with 7 additions and 7 deletions
@@ -391,7 +391,7 @@ export class ElasticResponse {
}
getTimeSeries() {
if (this.targets.some((target: any) => target.metrics.some((metric: any) => metric.type === 'raw_document_v2'))) {
if (this.targets.some((target: any) => target.metrics.some((metric: any) => metric.type === 'raw_data'))) {
return this.processResponseToDataFrames(false);
}
return this.processResponseToSeries();
@@ -102,7 +102,7 @@ export class ElasticMetricAggCtrl {
break;
}
case 'raw_document':
case 'raw_document_v2': {
case 'raw_data': {
$scope.agg.settings.size = $scope.agg.settings.size || 500;
$scope.settingsLinkText = 'Size: ' + $scope.agg.settings.size;
$scope.target.metrics.splice(0, $scope.target.metrics.length, $scope.agg);
@@ -167,7 +167,7 @@ export class ElasticMetricAggCtrl {
// reset back to metric/group by query
if (
$scope.target.bucketAggs.length === 0 &&
($scope.agg.type !== 'raw_document' || $scope.agg.type !== 'raw_document_v2')
($scope.agg.type !== 'raw_document' || $scope.agg.type !== 'raw_data')
) {
$scope.target.bucketAggs = [queryDef.defaultBucketAgg()];
}
@@ -213,7 +213,7 @@ export class ElasticQueryBuilder {
if (target.bucketAggs.length === 0) {
metric = target.metrics[0];
if (!metric || !(metric.type === 'raw_document' || metric.type === 'raw_document_v2')) {
if (!metric || !(metric.type === 'raw_document' || metric.type === 'raw_data')) {
throw { message: 'Invalid query' };
}
}
@@ -222,7 +222,7 @@ export class ElasticQueryBuilder {
* Check if metric type is raw_document. If metric doesn't have size (or size is 0), update size to 500.
* Otherwise it will not be a valid query and error will be thrown.
*/
if (target.metrics?.[0]?.type === 'raw_document' || target.metrics?.[0]?.type === 'raw_document_v2') {
if (target.metrics?.[0]?.type === 'raw_document' || target.metrics?.[0]?.type === 'raw_data') {
metric = target.metrics[0];
const size = (metric.settings && metric.settings.size !== 0 && metric.settings.size) || 500;
return this.documentQuery(query, size);
@@ -79,8 +79,8 @@ export const metricAggTypes = [
supportsMultipleBucketPaths: true,
minVersion: 2,
},
{ text: 'Raw Document', value: 'raw_document', requiresField: false },
{ text: 'Raw Document v2', value: 'raw_document_v2', requiresField: false },
{ text: 'Raw Document (legacy)', value: 'raw_document', requiresField: false },
{ text: 'Raw data', value: 'raw_data', requiresField: false },
{ text: 'Logs', value: 'logs', requiresField: false },
];