Report jsc memory information to fbsystrace

Reviewed By: jspahrsummers

Differential Revision: D2789593

fb-gh-sync-id: e31d5f174b9cf896ce3be6431d81264d1d240fdb
This commit is contained in:
Mike Armstrong 2015-12-29 23:36:34 -08:00 committed by facebook-github-bot-7
parent fe07a9c576
commit 8cabdbae1e
2 changed files with 13 additions and 0 deletions

View File

@ -147,6 +147,7 @@ class MessageQueue {
this._queue = [[],[],[]];
this._lastFlush = now;
}
Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length);
if (__DEV__ && SPY_MODE && isFinite(module)) {
console.log('JS->N : ' + this._remoteModuleTable[module] + '.' +
this._remoteMethodTable[module][method] + '(' + JSON.stringify(params) + ')');

View File

@ -92,6 +92,18 @@ var Systrace = {
}
},
/**
* counterEvent registers the value to the profileName on the systrace timeline
**/
counterEvent(profileName?: any, value?: any) {
if (_enabled) {
profileName = typeof profileName === 'function' ?
profileName() : profileName;
global.nativeTraceCounter &&
global.nativeTraceCounter(TRACE_TAG_REACT_APPS, profileName, value);
}
},
reactPerfMeasure(objName: string, fnName: string, func: any): any {
return function (component) {
if (!_enabled) {