track onMessage performance
Summary: Tracking the time of onMessage callback Reviewed By: passy Differential Revision: D15536546 fbshipit-source-id: 9e93c11555a0a045ef60355ec1d0c6ca7cd49cdd
This commit is contained in:
committed by
Facebook Github Bot
parent
cb79b3b9ba
commit
6aa3457fb4
@@ -112,9 +112,17 @@ export default class Client extends EventEmitter {
|
|||||||
const client = this;
|
const client = this;
|
||||||
this.responder = {
|
this.responder = {
|
||||||
fireAndForget: (payload: {data: string}) =>
|
fireAndForget: (payload: {data: string}) =>
|
||||||
requestIdleCallback(() => client.onMessage(payload.data), {
|
requestIdleCallback(
|
||||||
|
() => {
|
||||||
|
const mark = 'onMessageCallback';
|
||||||
|
performance.mark();
|
||||||
|
client.onMessage(payload.data);
|
||||||
|
this.logger.trackTimeSince(mark);
|
||||||
|
},
|
||||||
|
{
|
||||||
timeout: 500,
|
timeout: 500,
|
||||||
}),
|
},
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (conn) {
|
if (conn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user