[ML] Transforms: Adds retention policy options to transform UI. (#91162)

Adds retention policy options to the transform UI.
This commit is contained in:
Walter Rafelsberger 2021-02-16 21:29:56 +01:00 committed by GitHub
parent 3fe5228731
commit 073cd4d508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 614 additions and 128 deletions

View file

@ -51,6 +51,13 @@ export type PivotConfig = TypeOf<typeof pivotSchema>;
export type LatestFunctionConfig = TypeOf<typeof latestFunctionSchema>;
export const retentionPolicySchema = schema.object({
time: schema.object({
field: schema.string(),
max_age: schema.string(),
}),
});
export const settingsSchema = schema.object({
max_page_search_size: schema.maybe(schema.number()),
// The default value is null, which disables throttling.
@ -94,6 +101,7 @@ export const putTransformsRequestSchema = schema.object(
* Latest and pivot are mutually exclusive, i.e. exactly one must be specified in the transform configuration
*/
latest: schema.maybe(latestFunctionSchema),
retention_policy: schema.maybe(retentionPolicySchema),
settings: schema.maybe(settingsSchema),
source: sourceSchema,
sync: schema.maybe(syncSchema),

View file

@ -9,7 +9,7 @@ import { schema, TypeOf } from '@kbn/config-schema';
import { TransformPivotConfig } from '../types/transform';
import { settingsSchema, sourceSchema, syncSchema } from './transforms';
import { retentionPolicySchema, settingsSchema, sourceSchema, syncSchema } from './transforms';
// POST _transform/{transform_id}/_update
export const postTransformsUpdateRequestSchema = schema.object({
@ -22,6 +22,7 @@ export const postTransformsUpdateRequestSchema = schema.object({
})
),
frequency: schema.maybe(schema.string()),
retention_policy: schema.maybe(retentionPolicySchema),
settings: schema.maybe(settingsSchema),
source: schema.maybe(sourceSchema),
sync: schema.maybe(syncSchema),

View file

@ -33,6 +33,8 @@ export interface TransformStats {
attributes: Record<string, any>;
};
stats: {
delete_time_in_ms: number;
documents_deleted: number;
documents_indexed: number;
documents_processed: number;
index_failures: number;