mattermost-mobile/app/actions/remote/performance.ts
Daniel Espino García 5f01f9e9af
Add performance metrics to the app (#7953)
* Add performance metrics to the app

* add batcher and improve handling

* Add tests

* Fix test

* Address feedback

* Address feedback

* Address feedback

* update podfile
2024-06-12 09:45:27 +02:00

20 lines
730 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import NetworkManager from '@managers/network_manager';
import {getFullErrorMessage} from '@utils/errors';
import {logDebug} from '@utils/log';
import {forceLogoutIfNecessary} from './session';
export const sendPerformanceReport = async (serverUrl: string, report: PerformanceReport) => {
try {
const client = NetworkManager.getClient(serverUrl);
await client.sendPerformanceReport(report);
return {};
} catch (error) {
logDebug('error on sendPerformanceReport', getFullErrorMessage(error));
forceLogoutIfNecessary(serverUrl, error);
return {error};
}
};