import { TestData } from './types' ; import { ML_JOB_FIELD_TYPES } from '../../../../../plugins/ml/common/constants/field_types' ; export const farequoteDataViewTestData = { suiteTitle : 'farequote index pattern' , isSavedSearch : false , sourceIndexOrSavedSearch : 'ft_farequote' , fieldNameFilters : [ 'airline' , '@timestamp' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . KEYWORD ] , sampleSizeValidations : [ { size : 1000 , expected : { field : 'airline' , docCountFormatted : '1000 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '5000 (100%)' } } , ] , expected : { totalDocCountFormatted : '86,274' , metricFields : [ { fieldName : 'responsetime' , type : ML_JOB_FIELD_TYPES . NUMBER , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , statsMaxDecimalPlaces : 3 , topValuesCount : 10 , viewableInLens : true , } , ] , nonMetricFields : [ { fieldName : '@timestamp' , type : ML_JOB_FIELD_TYPES . DATE , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , exampleCount : 2 , viewableInLens : true , } , { fieldName : '@version' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : '@version.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'airline' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 10 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'type' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : 'type.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , ] , emptyFields : [ 'sourcetype' ] , visibleMetricFieldsCount : 1 , totalMetricFieldsCount : 1 , populatedFieldsCount : 7 , totalFieldsCount : 8 , fieldNameFiltersResultCount : 2 , fieldTypeFiltersResultCount : 3 , } , } ; export const farequoteKQLSearchTestData = { suiteTitle : 'KQL saved search' , isSavedSearch : true , sourceIndexOrSavedSearch : 'ft_farequote_kuery' , fieldNameFilters : [ '@version' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . DATE , ML_JOB_FIELD_TYPES . TEXT ] , sampleSizeValidations : [ { size : 1000 , expected : { field : 'airline' , docCountFormatted : '1000 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '5000 (100%)' } } , ] , expected : { totalDocCountFormatted : '34,415' , metricFields : [ { fieldName : 'responsetime' , type : ML_JOB_FIELD_TYPES . NUMBER , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , statsMaxDecimalPlaces : 3 , topValuesCount : 10 , viewableInLens : true , } , ] , nonMetricFields : [ { fieldName : '@timestamp' , type : ML_JOB_FIELD_TYPES . DATE , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , exampleCount : 2 , viewableInLens : true , } , { fieldName : '@version' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : '@version.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'airline' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 5 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'type' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : 'type.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , ] , emptyFields : [ 'sourcetype' ] , visibleMetricFieldsCount : 1 , totalMetricFieldsCount : 1 , populatedFieldsCount : 7 , totalFieldsCount : 8 , fieldNameFiltersResultCount : 1 , fieldTypeFiltersResultCount : 3 , } , } ; export const farequoteKQLFiltersSearchTestData = { suiteTitle : 'KQL saved search and filters' , isSavedSearch : true , sourceIndexOrSavedSearch : 'ft_farequote_filter_and_kuery' , fieldNameFilters : [ '@version' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . DATE , ML_JOB_FIELD_TYPES . TEXT ] , sampleSizeValidations : [ { size : 1000 , expected : { field : 'airline' , docCountFormatted : '1000 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '5000 (100%)' } } , ] , expected : { filters : [ { key : 'airline' , value : 'ASA' } ] , totalDocCountFormatted : '5,674' , metricFields : [ { fieldName : 'responsetime' , type : ML_JOB_FIELD_TYPES . NUMBER , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , statsMaxDecimalPlaces : 3 , topValuesCount : 10 , viewableInLens : true , } , ] , nonMetricFields : [ { fieldName : '@timestamp' , type : ML_JOB_FIELD_TYPES . DATE , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , exampleCount : 2 , viewableInLens : true , } , { fieldName : '@version' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : '@version.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'airline' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , exampleContent : [ 'ASA' ] , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'type' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : 'type.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , ] , emptyFields : [ 'sourcetype' ] , visibleMetricFieldsCount : 1 , totalMetricFieldsCount : 1 , populatedFieldsCount : 7 , totalFieldsCount : 8 , fieldNameFiltersResultCount : 1 , fieldTypeFiltersResultCount : 3 , } , } ; export const farequoteLuceneSearchTestData = { suiteTitle : 'lucene saved search' , isSavedSearch : true , sourceIndexOrSavedSearch : 'ft_farequote_lucene' , fieldNameFilters : [ '@version.keyword' , 'type' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . NUMBER ] , sampleSizeValidations : [ { size : 1000 , expected : { field : 'airline' , docCountFormatted : '1000 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '5000 (100%)' } } , ] , expected : { totalDocCountFormatted : '34,416' , metricFields : [ { fieldName : 'responsetime' , type : ML_JOB_FIELD_TYPES . NUMBER , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , statsMaxDecimalPlaces : 3 , topValuesCount : 10 , viewableInLens : true , } , ] , nonMetricFields : [ { fieldName : '@timestamp' , type : ML_JOB_FIELD_TYPES . DATE , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , exampleCount : 2 , viewableInLens : true , } , { fieldName : '@version' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : '@version.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'airline' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 5 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'type' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : 'type.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , ] , emptyFields : [ 'sourcetype' ] , visibleMetricFieldsCount : 1 , totalMetricFieldsCount : 1 , populatedFieldsCount : 7 , totalFieldsCount : 8 , fieldNameFiltersResultCount : 2 , fieldTypeFiltersResultCount : 1 , } , } ; export const farequoteLuceneFiltersSearchTestData = { suiteTitle : 'lucene saved search and filter' , isSavedSearch : true , sourceIndexOrSavedSearch : 'ft_farequote_filter_and_lucene' , fieldNameFilters : [ '@version.keyword' , 'type' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . NUMBER ] , sampleSizeValidations : [ { size : 1000 , expected : { field : 'airline' , docCountFormatted : '1000 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '5000 (100%)' } } , ] , expected : { filters : [ { key : 'airline' , value : 'ASA' } ] , totalDocCountFormatted : '5,673' , metricFields : [ { fieldName : 'responsetime' , type : ML_JOB_FIELD_TYPES . NUMBER , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , statsMaxDecimalPlaces : 3 , topValuesCount : 10 , viewableInLens : true , } , ] , nonMetricFields : [ { fieldName : '@timestamp' , type : ML_JOB_FIELD_TYPES . DATE , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '5000 (100%)' , exampleCount : 2 , viewableInLens : true , } , { fieldName : '@version' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : '@version.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'airline' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , exampleContent : [ 'ASA' ] , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , { fieldName : 'type' , type : ML_JOB_FIELD_TYPES . TEXT , existsInDocs : true , aggregatable : false , loading : false , exampleCount : 1 , docCountFormatted : '' , viewableInLens : false , } , { fieldName : 'type.keyword' , type : ML_JOB_FIELD_TYPES . KEYWORD , existsInDocs : true , aggregatable : true , loading : false , exampleCount : 1 , docCountFormatted : '5000 (100%)' , viewableInLens : true , } , ] , emptyFields : [ 'sourcetype' ] , visibleMetricFieldsCount : 1 , totalMetricFieldsCount : 1 , populatedFieldsCount : 7 , totalFieldsCount : 8 , fieldNameFiltersResultCount : 2 , fieldTypeFiltersResultCount : 1 , } , } ; export const sampleLogTestData = { suiteTitle : 'geo point field' , isSavedSearch : false , sourceIndexOrSavedSearch : 'ft_module_sample_logs' , fieldNameFilters : [ 'geo.coordinates' ] , fieldTypeFilters : [ ML_JOB_FIELD_TYPES . GEO_POINT ] , rowsPerPage : 50 , expected : { totalDocCountFormatted : '408' , metricFields : [ ] , nonMetricFields : [ { fieldName : 'geo.coordinates' , type : ML_JOB_FIELD_TYPES . GEO_POINT , existsInDocs : true , aggregatable : true , loading : false , docCountFormatted : '408 (100%)' , exampleCount : 10 , viewableInLens : false , } , ] , emptyFields : [ ] , visibleMetricFieldsCount : 4 , totalMetricFieldsCount : 5 , populatedFieldsCount : 35 , totalFieldsCount : 36 , fieldNameFiltersResultCount : 1 , fieldTypeFiltersResultCount : 1 , } , sampleSizeValidations : [ { size : 1000 , expected : { field : 'geo.coordinates' , docCountFormatted : '408 (100%)' } } , { size : 5000 , expected : { field : '@timestamp' , docCountFormatted : '408 (100%)' } } , ] , } ;