-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Refactoring anomaly detector job types (#59556)
* [ML] Refactoring anomaly detector job types * removing calendar type * update validateCardinality * fixing test * updating types in functional tests * using state constants
- Loading branch information
1 parent
492a97e
commit 92cc04c
Showing
63 changed files
with
536 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
x-pack/legacy/plugins/ml/common/types/anomaly_detection_jobs/datafeed_stats.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Node } from './job_stats'; | ||
import { DATAFEED_STATE } from '../../constants/states'; | ||
|
||
export interface DatafeedStats { | ||
datafeed_id: string; | ||
state: DATAFEED_STATE; | ||
node: Node; | ||
assignment_explanation: string; | ||
timing_stats: TimingStats; | ||
} | ||
|
||
interface TimingStats { | ||
job_id: string; | ||
search_count: number; | ||
bucket_count: number; | ||
total_search_time_ms: number; | ||
average_search_time_per_bucket_ms: number; | ||
exponential_average_search_time_per_hour_ms: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
x-pack/legacy/plugins/ml/common/types/anomaly_detection_jobs/job_stats.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { JOB_STATE } from '../../constants/states'; | ||
|
||
export interface JobStats { | ||
job_id: string; | ||
data_counts: DataCounts; | ||
model_size_stats: ModelSizeStats; | ||
forecasts_stats: ForecastsStats; | ||
state: JOB_STATE; | ||
node: Node; | ||
assignment_explanation: string; | ||
open_time: string; | ||
timing_stats: TimingStats; | ||
} | ||
|
||
export interface DataCounts { | ||
job_id: string; | ||
processed_record_count: number; | ||
processed_field_count: number; | ||
input_bytes: number; | ||
input_field_count: number; | ||
invalid_date_count: number; | ||
missing_field_count: number; | ||
out_of_order_timestamp_count: number; | ||
empty_bucket_count: number; | ||
sparse_bucket_count: number; | ||
bucket_count: number; | ||
earliest_record_timestamp: number; | ||
latest_record_timestamp: number; | ||
last_data_time: number; | ||
input_record_count: number; | ||
latest_empty_bucket_timestamp: number; | ||
latest_sparse_bucket_timestamp: number; | ||
latest_bucket_timestamp?: number; // stat added by the UI | ||
} | ||
|
||
export interface ModelSizeStats { | ||
job_id: string; | ||
result_type: string; | ||
model_bytes: number; | ||
model_bytes_exceeded: number; | ||
model_bytes_memory_limit: number; | ||
total_by_field_count: number; | ||
total_over_field_count: number; | ||
total_partition_field_count: number; | ||
bucket_allocation_failures_count: number; | ||
memory_status: 'ok' | 'soft_limit' | 'hard_limit'; | ||
categorized_doc_count: number; | ||
total_category_count: number; | ||
frequent_category_count: number; | ||
rare_category_count: number; | ||
dead_category_count: number; | ||
categorization_status: 'ok' | 'warn'; | ||
log_time: number; | ||
timestamp: number; | ||
} | ||
|
||
export interface ForecastsStats { | ||
total: number; | ||
forecasted_jobs: number; | ||
memory_bytes?: any; | ||
records?: any; | ||
processing_time_ms?: any; | ||
status?: any; | ||
} | ||
|
||
export interface Node { | ||
id: string; | ||
name: string; | ||
ephemeral_id: string; | ||
transport_address: string; | ||
attributes: { | ||
'transform.remote_connect'?: boolean; | ||
'ml.machine_memory'?: number; | ||
'xpack.installed'?: boolean; | ||
'transform.node'?: boolean; | ||
'ml.max_open_jobs'?: number; | ||
}; | ||
} | ||
|
||
interface TimingStats { | ||
job_id: string; | ||
bucket_count: number; | ||
total_bucket_processing_time_ms: number; | ||
minimum_bucket_processing_time_ms: number; | ||
maximum_bucket_processing_time_ms: number; | ||
average_bucket_processing_time_ms: number; | ||
exponential_average_bucket_processing_time_ms: number; | ||
exponential_average_bucket_processing_time_per_hour_ms: number; | ||
} |
57 changes: 57 additions & 0 deletions
57
x-pack/legacy/plugins/ml/common/types/anomaly_detection_jobs/summary_job.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Moment } from 'moment'; | ||
|
||
import { CombinedJob, CombinedJobWithStats } from './combined_job'; | ||
export { Datafeed } from './datafeed'; | ||
export { DatafeedStats } from './datafeed_stats'; | ||
|
||
export interface MlSummaryJob { | ||
id: string; | ||
description: string; | ||
groups: string[]; | ||
processed_record_count?: number; | ||
memory_status?: string; | ||
jobState: string; | ||
datafeedIndices: string[]; | ||
hasDatafeed: boolean; | ||
datafeedId: string; | ||
datafeedState: string; | ||
latestTimestampMs?: number; | ||
earliestTimestampMs?: number; | ||
latestResultsTimestampMs?: number; | ||
fullJob?: CombinedJob; | ||
nodeName?: string; | ||
auditMessage?: Partial<AuditMessage>; | ||
isSingleMetricViewerJob: boolean; | ||
deleting?: boolean; | ||
latestTimestampSortValue?: number; | ||
} | ||
|
||
export interface AuditMessage { | ||
job_id: string; | ||
msgTime: number; | ||
level: number; | ||
highestLevel: number; | ||
highestLevelText: string; | ||
text: string; | ||
} | ||
|
||
export type MlSummaryJobs = MlSummaryJob[]; | ||
|
||
export interface MlJobWithTimeRange extends CombinedJobWithStats { | ||
timeRange: { | ||
from: number; | ||
to: number; | ||
fromPx: number; | ||
toPx: number; | ||
fromMoment: Moment; | ||
toMoment: Moment; | ||
widthPx: number; | ||
label: string; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.