Refactor browser connection performance tracking
Reviewed By: lblasa Differential Revision: D51158256 fbshipit-source-id: 17e020dd3c26ac73bf2cf0ceb4c664638c6778e9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
54217f2c79
commit
d54bd7c3ba
@@ -27,7 +27,6 @@ import {
|
||||
} from 'flipper-server-companion';
|
||||
import {URLSearchParams} from 'url';
|
||||
import {tracker} from '../tracker';
|
||||
import {performance} from 'perf_hooks';
|
||||
import {getFlipperServerConfig} from '../FlipperServerConfig';
|
||||
|
||||
const safe = (f: () => void) => {
|
||||
@@ -53,14 +52,6 @@ export function attachSocketServer(
|
||||
server: FlipperServerImpl,
|
||||
companionEnv: FlipperServerCompanionEnv,
|
||||
) {
|
||||
const t0 = performance.now();
|
||||
const browserConnectionTimeout = setTimeout(() => {
|
||||
tracker.track('browser-connection-created', {
|
||||
successful: false,
|
||||
timeMS: performance.now() - t0,
|
||||
});
|
||||
}, 20000);
|
||||
|
||||
socket.on('connection', (client, req) => {
|
||||
const clientAddress =
|
||||
(req.socket.remoteAddress &&
|
||||
@@ -74,11 +65,7 @@ export function attachSocketServer(
|
||||
clearTimeout(disconnectTimeout);
|
||||
}
|
||||
|
||||
clearTimeout(browserConnectionTimeout);
|
||||
tracker.track('browser-connection-created', {
|
||||
successful: true,
|
||||
timeMS: performance.now() - t0,
|
||||
});
|
||||
server.emit('browser-connection-created', {});
|
||||
|
||||
let connected = true;
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ type TrackerEvents = {
|
||||
'browser-connection-created': {
|
||||
successful: boolean;
|
||||
timeMS: number;
|
||||
timedOut: boolean;
|
||||
};
|
||||
'app-connection-created': AppConnectionPayload;
|
||||
'app-connection-secure-attempt': AppConnectionPayload;
|
||||
|
||||
Reference in New Issue
Block a user