2015-06-19 21:59:42 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
#import "RCTDefines.h"
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, RCTPLTag) {
|
|
|
|
RCTPLScriptDownload = 0,
|
2015-08-21 18:33:04 +00:00
|
|
|
RCTPLScriptExecution,
|
|
|
|
RCTPLNativeModuleInit,
|
2016-03-15 12:40:09 +00:00
|
|
|
RCTPLNativeModuleMainThread,
|
2015-10-08 15:41:55 +00:00
|
|
|
RCTPLNativeModulePrepareConfig,
|
2015-10-05 17:53:33 +00:00
|
|
|
RCTPLNativeModuleInjectConfig,
|
2016-03-16 16:46:55 +00:00
|
|
|
RCTPLNativeModuleMainThreadUsesCount,
|
2016-03-15 12:40:09 +00:00
|
|
|
RCTPLJSCExecutorSetup,
|
2015-06-19 21:59:42 +00:00
|
|
|
RCTPLTTI,
|
2015-10-21 17:53:35 +00:00
|
|
|
RCTPLBundleSize,
|
2015-06-19 21:59:42 +00:00
|
|
|
RCTPLSize
|
|
|
|
};
|
|
|
|
|
2016-03-15 12:40:09 +00:00
|
|
|
/**
|
|
|
|
* Starts measuring a metric with the given tag.
|
|
|
|
* Overrides previous value if the measurement has been already started.
|
|
|
|
* If RCTProfile is enabled it also begins appropriate async event.
|
|
|
|
*/
|
2016-03-11 11:17:48 +00:00
|
|
|
RCT_EXTERN void RCTPerformanceLoggerStart(RCTPLTag tag);
|
2016-03-15 12:40:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stops measuring a metric with given tag.
|
|
|
|
* Checks if RCTPerformanceLoggerStart() has been called before
|
|
|
|
* and doesn't do anything and log a message if it hasn't.
|
|
|
|
* If RCTProfile is enabled it also ends appropriate async event.
|
|
|
|
*/
|
2016-03-11 11:17:48 +00:00
|
|
|
RCT_EXTERN void RCTPerformanceLoggerEnd(RCTPLTag tag);
|
2016-03-15 12:40:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets given value for a metric with given tag.
|
|
|
|
*/
|
2016-03-11 11:17:48 +00:00
|
|
|
RCT_EXTERN void RCTPerformanceLoggerSet(RCTPLTag tag, int64_t value);
|
2016-03-15 12:40:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts an additional measurement for a metric with given tag.
|
|
|
|
* It doesn't override previous measurement, instead it'll append a new value
|
|
|
|
* to the old one.
|
|
|
|
*/
|
|
|
|
RCT_EXTERN void RCTPerformanceLoggerAppendStart(RCTPLTag tag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stops measurement and appends the result to the metric with given tag.
|
|
|
|
* Checks if RCTPerformanceLoggerAppendStart() has been called before
|
|
|
|
* and doesn't do anything and log a message if it hasn't.
|
|
|
|
*/
|
|
|
|
RCT_EXTERN void RCTPerformanceLoggerAppendEnd(RCTPLTag tag);
|
|
|
|
|
2016-03-11 11:17:48 +00:00
|
|
|
RCT_EXTERN NSArray<NSNumber *> *RCTPerformanceLoggerOutput(void);
|
|
|
|
RCT_EXTERN NSArray *RCTPerformanceLoggerLabels(void);
|