Track state changes
Summary: Track server connectivity state changes, queries will follow. Reviewed By: antonk52 Differential Revision: D50928297 fbshipit-source-id: 9f3a3b799481556bab7339d710736448fed6004c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
afae1bd141
commit
87cb9bd77a
@@ -97,11 +97,18 @@ async function start() {
|
|||||||
|
|
||||||
getLogger().info('[flipper-client][ui-browser] Create WS client');
|
getLogger().info('[flipper-client][ui-browser] Create WS client');
|
||||||
|
|
||||||
|
let lastStateChangeMS = performance.now();
|
||||||
const flipperServer = await createFlipperServer(
|
const flipperServer = await createFlipperServer(
|
||||||
location.hostname,
|
location.hostname,
|
||||||
parseInt(location.port, 10),
|
parseInt(location.port, 10),
|
||||||
tokenProvider,
|
tokenProvider,
|
||||||
(state: FlipperServerState) => {
|
(state: FlipperServerState) => {
|
||||||
|
const timestamp = performance.now();
|
||||||
|
getLogger().track('usage', 'browser-server-state-changed', {
|
||||||
|
state,
|
||||||
|
timeElapsedMS: timestamp - lastStateChangeMS,
|
||||||
|
});
|
||||||
|
lastStateChangeMS = timestamp;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case FlipperServerState.CONNECTING:
|
case FlipperServerState.CONNECTING:
|
||||||
getLogger().info('[flipper-client] Connecting to server');
|
getLogger().info('[flipper-client] Connecting to server');
|
||||||
|
|||||||
Reference in New Issue
Block a user