Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
Fix showing RCTPerformanceLogger data
Browse files Browse the repository at this point in the history
Reviewed By: nicklockwood

Differential Revision: D3064023

fb-gh-sync-id: df9358dddfcc79e12a65a8b9c182615be64fc468
shipit-source-id: df9358dddfcc79e12a65a8b9c182615be64fc468
  • Loading branch information
alexeylang authored and Facebook Github Bot 9 committed Mar 17, 2016
1 parent 55477ff commit 24f7d88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions React/Base/RCTPerformanceLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void RCTPerformanceLoggerAppendEnd(RCTPLTag tag)
@"NativeModuleMainThread",
@"NativeModulePrepareConfig",
@"NativeModuleInjectConfig",
@"NativeModuleMainThreadUsesCount",
@"JSCExecutorSetup",
@"RootViewTTI",
@"BundleSize",
Expand Down
7 changes: 6 additions & 1 deletion React/Profiler/RCTPerfMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,12 @@ - (void)loadPerformanceLoggerData
NSArray<NSNumber *> *values = RCTPerformanceLoggerOutput();
for (NSString *label in RCTPerformanceLoggerLabels()) {
long long value = values[i+1].longLongValue - values[i].longLongValue;
NSString *unit = [label isEqualToString:@"BundleSize"] ? @"b" : @"ms";
NSString *unit = @"ms";
if ([label hasSuffix:@"Size"]) {
unit = @"b";
} else if ([label hasSuffix:@"Count"]) {
unit = @"";
}
[data addObject:[NSString stringWithFormat:@"%@: %lld%@", label, value, unit]];
i += 2;
}
Expand Down

0 comments on commit 24f7d88

Please sign in to comment.