631
renderStartTime: number,
632
lanes: Lanes,
633
debugTask: null | ConsoleTask, // DEV-only
634
+ updateMethodName: null | string,
635
+ updateComponentName: null | string,
636
): void {
637
if (supportsUserTiming) {
638
currentTrack = 'Blocking';
674
: includesOnlyHydrationOrOffscreenLanes(lanes)
675
? 'tertiary-light'
676
: 'primary-light';
675
- if (__DEV__ && debugTask) {
676
- debugTask.run(
677
- // $FlowFixMe[method-unbinding]
678
- console.timeStamp.bind(
679
- console,
680
- isPingedUpdate
681
- ? 'Promise Resolved'
682
- : isSpawnedUpdate
683
- ? 'Cascading Update'
684
- : renderStartTime - updateTime > 5
685
- ? 'Update Blocked'
686
- : 'Update',
687
- updateTime,
688
- renderStartTime,
689
- currentTrack,
690
- LANES_TRACK_GROUP,
691
- color,
692
- ),
693
- );
677
+ const label = isPingedUpdate
678
+ ? 'Promise Resolved'
679
+ : isSpawnedUpdate
680
+ ? 'Cascading Update'
681
+ : renderStartTime - updateTime > 5
682
+ ? 'Update Blocked'
683
+ : 'Update';
684
+
685
+ if (__DEV__) {
686
+ const properties = [];
687
+ if (updateComponentName != null) {
688
+ properties.push(['Component name', updateComponentName]);
689
+ }
690
+ if (updateMethodName != null) {
691
+ properties.push(['Method name', updateMethodName]);
692
+ }
693
+ const measureOptions = {
694
+ start: updateTime,
695
+ end: renderStartTime,
696
+ detail: {
697
+ devtools: {
698
+ properties,
699
+ track: currentTrack,
700
+ trackGroup: LANES_TRACK_GROUP,
701
+ color,
702
+ },
703
+ },
704
+ };
705
+
706
+ if (debugTask) {
707
+ debugTask.run(
708
+ // $FlowFixMe[method-unbinding]
709
+ performance.measure.bind(performance, label, measureOptions),
710
+ );
711
+ } else {
712
+ performance.measure(label, measureOptions);
713
+ }
714
} else {
715
console.timeStamp(
696
- isPingedUpdate
697
- ? 'Promise Resolved'
698
- : isSpawnedUpdate
699
- ? 'Cascading Update'
700
- : renderStartTime - updateTime > 5
701
- ? 'Update Blocked'
702
- : 'Update',
716
+ label,
717
updateTime,
718
renderStartTime,
719
currentTrack,
734
isPingedUpdate: boolean,
735
renderStartTime: number,
736
debugTask: null | ConsoleTask, // DEV-only
737
+ updateMethodName: null | string,
738
+ updateComponentName: null | string,
739
): void {
740
if (supportsUserTiming) {
741
currentTrack = 'Transition';
797
}
798
if (updateTime > 0 && renderStartTime > updateTime) {
799
// Log the time from when we called setState until we started rendering.
784
- if (__DEV__ && debugTask) {
785
- debugTask.run(
786
- // $FlowFixMe[method-unbinding]
787
- console.timeStamp.bind(
788
- console,
789
- isPingedUpdate
790
- ? 'Promise Resolved'
791
- : renderStartTime - updateTime > 5
792
- ? 'Update Blocked'
793
- : 'Update',
794
- updateTime,
795
- renderStartTime,
796
- currentTrack,
797
- LANES_TRACK_GROUP,
798
- 'primary-light',
799
- ),
800
- );
800
+ const label = isPingedUpdate
801
+ ? 'Promise Resolved'
802
+ : renderStartTime - updateTime > 5
803
+ ? 'Update Blocked'
804
+ : 'Update';
805
+ if (__DEV__) {
806
+ const properties = [];
807
+ if (updateComponentName != null) {
808
+ properties.push(['Component name', updateComponentName]);
809
+ }
810
+ if (updateMethodName != null) {
811
+ properties.push(['Method name', updateMethodName]);
812
+ }
813
+ const measureOptions = {
814
+ start: updateTime,
815
+ end: renderStartTime,
816
+ detail: {
817
+ devtools: {
818
+ properties,
819
+ track: currentTrack,
820
+ trackGroup: LANES_TRACK_GROUP,
821
+ color: 'primary-light',
822
+ },
823
+ },
824
+ };
825
+
826
+ if (debugTask) {
827
+ debugTask.run(
828
+ // $FlowFixMe[method-unbinding]
829
+ performance.measure.bind(performance, label, measureOptions),
830
+ );
831
+ } else {
832
+ performance.measure(label, measureOptions);
833
+ }
834
} else {
835
console.timeStamp(
803
- isPingedUpdate
804
- ? 'Promise Resolved'
805
- : renderStartTime - updateTime > 5
806
- ? 'Update Blocked'
807
- : 'Update',
836
+ label,
837
updateTime,
838
renderStartTime,
839
currentTrack,