import type { FailedTransactionsCorrelation } from '../../../../../common/correlations/failed_transactions_correlations/types' ; import type { LatencyCorrelation } from '../../../../../common/correlations/latency_correlations/types' ; export interface CorrelationsProgress { error ? : string ; isRunning : boolean ; loaded : number ; } export function getLatencyCorrelationsSortedByCorrelation ( latencyCorrelations ) { return latencyCorrelations . sort ( ( a , b ) => b . correlation - a . correlation ) ; } export function getFailedTransactionsCorrelationsSortedByScore ( failedTransactionsCorrelations ) { return failedTransactionsCorrelations . sort ( ( a , b ) => b . score - a . score ) ; } export const getInitialResponse = ( ) => ( { ccsWarning : false , isRunning : false , loaded : 0 , } ) ; export const getReducer = < T > ( ) => ( prev , update ) : T => ( { ... prev , ... update , } ) ;