Skip to content

Commit

Permalink
Add JSON methods to systrace
Browse files Browse the repository at this point in the history
Summary: public Add JSON methods to systraces

Reviewed By: jspahrsummers

Differential Revision: D2679719

fb-gh-sync-id: d8bbdc9577264b1de01d7bb52656f4f1a86a5982
  • Loading branch information
milend authored and facebook-github-bot-7 committed Nov 23, 2015
1 parent 02b67d9 commit e4dca7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Libraries/Utilities/BridgeProfiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit e4dca7a

Please sign in to comment.