From b65f0bd122a0bff816cd790d9e5193ff638757ae Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 12 Jul 2022 13:15:28 +0200 Subject: [PATCH] [ML] Add TODO comments about possible code consolidation. (#136181) --- .../src/progress_controls/progress_controls.tsx | 3 +++ .../aiops/server/routes/queries/fetch_change_point_p_values.ts | 3 +++ .../aiops/server/routes/queries/fetch_field_candidates.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx b/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx index 53de10fcd9f2b..22344427e8d27 100644 --- a/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx +++ b/x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx @@ -10,6 +10,9 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; +// TODO Consolidate with duplicate component `CorrelationsProgressControls` in +// `x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx` + interface ProgressControlProps { progress: number; progressMessage: string; diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts index f8b088b76a713..240eda6e328b5 100644 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_change_point_p_values.ts @@ -15,6 +15,9 @@ import { ChangePoint } from '../../../common/types'; import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; +// TODO Consolidate with duplicate `fetchDurationFieldCandidates` in +// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_failed_events_correlation_p_values.ts` + export const getChangePointRequest = ( params: AiopsExplainLogRateSpikesSchema, fieldName: string diff --git a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts b/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts index 78d154435c4a6..7a761d91c0da5 100644 --- a/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts +++ b/x-pack/plugins/aiops/server/routes/queries/fetch_field_candidates.ts @@ -16,6 +16,9 @@ import type { AiopsExplainLogRateSpikesSchema } from '../../../common/api/explai import { getQueryWithParams } from './get_query_with_params'; import { getRequestBase } from './get_request_base'; +// TODO Consolidate with duplicate `fetchPValues` in +// `x-pack/plugins/apm/server/routes/correlations/queries/fetch_duration_field_candidates.ts` + const POPULATED_DOC_COUNT_SAMPLE_SIZE = 1000; const SUPPORTED_ES_FIELD_TYPES = [