Skip to content

Commit 12a6742

Browse files
Adding string annotations to markEvent
Summary: Adding string annotations support to markEvent API in ReactNative Changelog: [Internal][Change] - markEvent API now supports string annotations Differential Revision: D33795346 fbshipit-source-id: 414cbd08ce5ff6045e2f35ae77059be5add3d834
1 parent 0e39b95 commit 12a6742

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Libraries/Performance/QuickPerformanceLogger.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
const AUTO_SET_TIMESTAMP = -1;
1414
const DUMMY_INSTANCE_KEY = 0;
1515

16+
// Defines map of annotations for markEvent
17+
// Use as following:
18+
// {string: {key1: value1, key2: value2}}
19+
export type AnnotationsMap = $Shape<{
20+
string: ?{[string]: string, ...},
21+
}>;
22+
1623
const QuickPerformanceLogger = {
1724
markerStart(
1825
markerId: number,
@@ -90,9 +97,13 @@ const QuickPerformanceLogger = {
9097
}
9198
},
9299

93-
markEvent(markerId: number, type: string): void {
100+
markEvent(
101+
markerId: number,
102+
type: string,
103+
annotations: ?AnnotationsMap = null,
104+
): void {
94105
if (global.nativeQPLMarkEvent) {
95-
global.nativeQPLMarkEvent(markerId, type);
106+
global.nativeQPLMarkEvent(markerId, type, annotations);
96107
}
97108
},
98109

0 commit comments

Comments
 (0)