1 import { SECOND } from '@proton/shared/lib/constants';
3 import Metrics from './Metrics';
4 import { METRICS_BATCH_SIZE, METRICS_REQUEST_FREQUENCY_SECONDS } from './constants';
5 import MetricsApi from './lib/MetricsApi';
6 import MetricsRequestService from './lib/MetricsRequestService';
8 export * from './lib/observeApiError';
9 export { default as observeApiError } from './lib/observeApiError';
11 const metricsApi = new MetricsApi();
12 const metricsRequestService = new MetricsRequestService(metricsApi, {
15 frequency: METRICS_REQUEST_FREQUENCY_SECONDS * SECOND,
16 size: METRICS_BATCH_SIZE,
19 const metrics = new Metrics(metricsRequestService);
21 export default metrics;