|
| 1 | +/* |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | + |
| 8 | +#import "RCTPerformanceLoggerLabels.h" |
| 9 | +#import <React/RCTAssert.h> |
| 10 | + |
| 11 | +NSString *RCTPLLabelForTag(RCTPLTag tag) |
| 12 | +{ |
| 13 | + switch (tag) { |
| 14 | + case RCTPLScriptDownload: |
| 15 | + return @"ScriptDownload"; |
| 16 | + case RCTPLScriptExecution: |
| 17 | + return @"ScriptExecution"; |
| 18 | + case RCTPLRAMBundleLoad: |
| 19 | + return @"RAMBundleLoad"; |
| 20 | + case RCTPLRAMStartupCodeSize: |
| 21 | + return @"RAMStartupCodeSize"; |
| 22 | + case RCTPLRAMStartupNativeRequires: |
| 23 | + return @"RAMStartupNativeRequires"; |
| 24 | + case RCTPLRAMStartupNativeRequiresCount: |
| 25 | + return @"RAMStartupNativeRequiresCount"; |
| 26 | + case RCTPLRAMNativeRequires: |
| 27 | + return @"RAMNativeRequires"; |
| 28 | + case RCTPLRAMNativeRequiresCount: |
| 29 | + return @"RAMNativeRequiresCount"; |
| 30 | + case RCTPLNativeModuleInit: |
| 31 | + return @"NativeModuleInit"; |
| 32 | + case RCTPLNativeModuleMainThread: |
| 33 | + return @"NativeModuleMainThread"; |
| 34 | + case RCTPLNativeModulePrepareConfig: |
| 35 | + return @"NativeModulePrepareConfig"; |
| 36 | + case RCTPLNativeModuleMainThreadUsesCount: |
| 37 | + return @"NativeModuleMainThreadUsesCount"; |
| 38 | + case RCTPLNativeModuleSetup: |
| 39 | + return @"NativeModuleSetup"; |
| 40 | + case RCTPLTurboModuleSetup: |
| 41 | + return @"TurboModuleSetup"; |
| 42 | + case RCTPLJSCWrapperOpenLibrary: |
| 43 | + return @"JSCWrapperOpenLibrary"; |
| 44 | + case RCTPLBridgeStartup: |
| 45 | + return @"BridgeStartup"; |
| 46 | + case RCTPLTTI: |
| 47 | + return @"RootViewTTI"; |
| 48 | + case RCTPLBundleSize: |
| 49 | + return @"BundleSize"; |
| 50 | + case RCTPLReactInstanceInit: |
| 51 | + return @"ReactInstanceInit"; |
| 52 | + case RCTPLSize: // Only used to count enum size |
| 53 | + RCTAssert(NO, @"RCTPLSize should not be used to track performance timestamps."); |
| 54 | + return nil; |
| 55 | + } |
| 56 | +} |
0 commit comments