Files
react-native/Libraries/Utilities/GlobalPerformanceLogger.js
Alexey Lang a9b3ca7fa7 Use global or scoped performance loggers everywhere
Summary:
I'm changing all callsites to use either global or scoped perf logger explicitly in one diff.
`GlobalPerformanceLogger` is basically a singleton
`scopedPerformanceLogger` is scoped to the React tree by using a React Context

Reviewed By: sahrens

Differential Revision: D14186694

fbshipit-source-id: 062c76eea8fce9d9b531f0eddf153bb79d52f68d
2019-03-06 09:51:56 -08:00

25 lines
830 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
'use strict';
const createPerformanceLogger = require('createPerformanceLogger');
/**
* This is a global shared instance of IPerformanceLogger that is created with
* createPerformanceLogger().
* Any metric that you log with this logger will be attached to *all* in-flight
* TTI/TTRC events so you should use it carefully. If you want to log something
* from your React component you should use PerformanceLoggerContext instead.
* This logger should be used only for global stuff like load_bundle events.
*/
const GlobalPerformanceLogger = createPerformanceLogger();
module.exports = GlobalPerformanceLogger;