Log query name for fetchRelayQuery

Reviewed By: yisun

Differential Revision: D6692869

fbshipit-source-id: 5484070be9995c5294197b0c2766690fd7accefa
This commit is contained in:
Alexey Lang 2018-01-11 04:14:55 -08:00 коммит произвёл Facebook Github Bot
Родитель 1c3f6acfe5
Коммит a9032a20ad
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -240,7 +240,10 @@ const Systrace = {
* therefore async variant of profiling is used * therefore async variant of profiling is used
**/ **/
attachToRelayProfiler(relayProfiler: RelayProfiler) { attachToRelayProfiler(relayProfiler: RelayProfiler) {
relayProfiler.attachProfileHandler('*', (name) => { relayProfiler.attachProfileHandler('*', (name, state?) => {
if (state != null && state.queryName !== undefined) {
name += '_' + state.queryName
}
const cookie = Systrace.beginAsyncEvent(name); const cookie = Systrace.beginAsyncEvent(name);
return () => { return () => {
Systrace.endAsyncEvent(name, cookie); Systrace.endAsyncEvent(name, cookie);