import { withApmSpan } from '../../../utils/with_apm_span' ; import { Setup } from '../../../lib/helpers/setup_request' ; import { getServiceTransactionDetailedStatistics } from './get_service_transaction_detailed_statistics' ; export async function getServicesDetailedStatistics ( { serviceNames , environment , kuery , setup , searchAggregatedTransactions , offset , start , end , } ) { return withApmSpan ( 'get_service_detailed_statistics' , async ( ) => { const commonProps = { serviceNames , environment , kuery , setup , searchAggregatedTransactions , start , end , } ; const [ currentPeriod , previousPeriod ] = await Promise . all ( [ getServiceTransactionDetailedStatistics ( commonProps ) , offset ? getServiceTransactionDetailedStatistics ( { ... commonProps , offset } ) : Promise . resolve ( { } ) , ] ) ; return { currentPeriod , previousPeriod } ; } ) ; }