mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add various annotation types to markEvent ReactNative API
Summary: Support various annotations types in QuickPerformanceLogger markEvent for Android. Changelog: [Internal][Changed] - Added support for various markEvent annotation types Reviewed By: dmitry-voronkevich Differential Revision: D40852658 fbshipit-source-id: fc4053555f65958653be30a58742c83040a19df1
This commit is contained in:
1 parent
aaf1990287
commit
890805db9c
1 file changed
+17
-1
@@ -18,6 +18,13 @@ const DUMMY_INSTANCE_KEY = 0;
|
||||
// {string: {key1: value1, key2: value2}}
|
||||
export type AnnotationsMap = $Shape<{
|
||||
string: ?{[string]: string, ...},
|
||||
int: ?{[string]: number, ...},
|
||||
double: ?{[string]: number, ...},
|
||||
bool: ?{[string]: boolean, ...},
|
||||
string_array: ?{[string]: $ReadOnlyArray<string>, ...},
|
||||
int_array: ?{[string]: $ReadOnlyArray<number>, ...},
|
||||
double_array: ?{[string]: $ReadOnlyArray<number>, ...},
|
||||
bool_array: ?{[string]: $ReadOnlyArray<boolean>, ...},
|
||||
}>;
|
||||
|
||||
const QuickPerformanceLogger = {
|
||||
@@ -60,7 +67,16 @@ const QuickPerformanceLogger = {
|
||||
if (global.nativeQPLMarkerAnnotateWithMap) {
|
||||
global.nativeQPLMarkerAnnotateWithMap(markerId, annotations, instanceKey);
|
||||
} else if (global.nativeQPLMarkerAnnotate) {
|
||||
for (const type of ['string']) {
|
||||
for (const type of [
|
||||
'string',
|
||||
'int',
|
||||
'double',
|
||||
'bool',
|
||||
'string_array',
|
||||
'int_array',
|
||||
'double_array',
|
||||
'bool_array',
|
||||
]) {
|
||||
const keyValsOfType = annotations[type];
|
||||
if (keyValsOfType != null) {
|
||||
for (const annotationKey of Object.keys(keyValsOfType)) {
|
||||
|
||||
Reference in new issue
Block a user