mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 09:29:39 +08:00
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
25 lines
830 B
JavaScript
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;
|