Skip to content

Commit

Permalink
RN: Delete Systrace for RelayClassic
Browse files Browse the repository at this point in the history
Reviewed By: TheSavior

Differential Revision: D7207462

fbshipit-source-id: 6dd5c5fd22c0a5a7d77331d6adf7b362c3d3e037
  • Loading branch information
yungsters authored and facebook-github-bot committed Mar 9, 2018
1 parent 118521c commit a8c4b63
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions Libraries/Performance/Systrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@

const invariant = require('fbjs/lib/invariant');

type RelayProfiler = {
attachProfileHandler(
name: string,
handler: (name: string, state?: any) => () => void,
): void,

attachAggregateHandler(
name: string,
handler: (name: string, callback: () => void) => void,
): void,
};

const TRACE_TAG_REACT_APPS = 1 << 17; // eslint-disable-line no-bitwise
const TRACE_TAG_JS_VM_CALLS = 1 << 27; // eslint-disable-line no-bitwise

Expand Down Expand Up @@ -195,28 +183,6 @@ const Systrace = {
}
},

/**
* Relay profiles use await calls, so likely occur out of current stack frame
* therefore async variant of profiling is used
**/
attachToRelayProfiler(relayProfiler: RelayProfiler) {
relayProfiler.attachProfileHandler('*', (name, state?) => {
if (state != null && state.queryName !== undefined) {
name += '_' + state.queryName;
}
const cookie = Systrace.beginAsyncEvent(name);
return () => {
Systrace.endAsyncEvent(name, cookie);
};
});

relayProfiler.attachAggregateHandler('*', (name, callback) => {
Systrace.beginEvent(name);
callback();
Systrace.endEvent();
});
},

/* 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() {
Expand Down

0 comments on commit a8c4b63

Please sign in to comment.