import { ProcessorEvent } from '../../../common/processor_event' ; import { Setup } from '../../lib/helpers/setup_request' ; export async function hasHistoricalAgentData ( setup ) { const { apmEventClient } = setup ; const params = { terminate_after : 1 , apm : { events : [ ProcessorEvent . error , ProcessorEvent . metric , ProcessorEvent . transaction , ] , } , body : { size : 0 , } , } ; const resp = await apmEventClient . search ( 'has_historical_agent_data' , params ) ; return resp . hits . total . value > 0 ; }