Add JSON methods to systrace

Summary: public Add JSON methods to systraces

Reviewed By: jspahrsummers

Differential Revision: D2679719

fb-gh-sync-id: d8bbdc9577264b1de01d7bb52656f4f1a86a5982
This commit is contained in:
Milen Dzhumerov 2015-11-23 07:01:11 -08:00 committed by facebook-github-bot-7
parent 02b67d9d40
commit e4dca7a1fa
1 changed files with 9 additions and 0 deletions

View File

@ -80,6 +80,15 @@ var BridgeProfiling = {
} catch(err) {}
},
/* This is not called by default due to perf overhead but it's useful
if you want to find traces which spend too much time in JSON. */
swizzleJSON() {
BridgeProfiling.measureMethods(JSON, 'JSON', [
'parse',
'stringify'
]);
},
/**
* Measures multiple methods of a class. For example, you can do:
* BridgeProfiling.measureMethods(JSON, 'JSON', ['parse', 'stringify']);