import { BucketAggType } from './bucket_agg_type' ; import { BaseAggParams } from '../types' ; import { aggShardDelayFnName } from './shard_delay_fn' ; export const SHARD_DELAY_AGG_NAME = 'shard_delay' ; export interface AggParamsShardDelay extends BaseAggParams { delay ? : number ; } export const getShardDelayBucketAgg = ( ) => new BucketAggType ( { name : SHARD_DELAY_AGG_NAME , title : 'Shard Delay' , expressionName : aggShardDelayFnName , createFilter : ( ) => ( { match_all : { } } ) , customLabels : false , params : [ { name : 'delay' , type : 'string' , default : '5s' , write ( aggConfig , output ) { output . params = { ... output . params , value : aggConfig . params . delay , } ; } , } , ] , } ) ;