message: Improve our ability to track perf of various stages of TreesLatest
diff: @@ -230,6 +230,8 @@ async function fetchLatestSnapshotCore(
  snapshotOptions.timeout,
  );
  }
  +
  + const start = performance.now();
  const response = await snapshotDownloader(
  odspResolvedUrl,
  storageToken,
  @@ -242,6 +244,7 @@ async function fetchLatestSnapshotCore(
  fetchTimeout = undefined;
  }
  });
  + const networkTimeJs = performance.now() - start;
  const odspResponse = response.odspResponse;
  const contentType = odspResponse.headers.get("content-type");
  @@ -350,7 +353,7 @@ async function fetchLatestSnapshotCore(
  let responseNetworkTime: number | undefined; // responsEnd - responseStart
  let fetchStartToResponseEndTime: number | undefined; // responseEnd - fetchStart
  let reqStartToResponseEndTime: number | undefined; // responseEnd - requestStart
  - let networkTime: number | undefined; // responseEnd - startTime
  + let networkTimeBrowser: number | undefined; // responseEnd - startTime
  const spReqDuration = odspResponse.headers.get("sprequestduration");
  // getEntriesByType is only available in browser performance object
  @@ -373,10 +376,10 @@ async function fetchLatestSnapshotCore(
  (indResTime.responseEnd - indResTime.fetchStart) : undefined;
  reqStartToResponseEndTime = (indResTime.requestStart > 0) ?
  (indResTime.responseEnd - indResTime.requestStart) : undefined;
  - networkTime = (indResTime.startTime > 0) ?
  + networkTimeBrowser = (indResTime.startTime > 0) ?
  (indResTime.responseEnd - indResTime.fetchStart) : undefined;
  - if (spReqDuration !== undefined && networkTime !== undefined) {
  - networkTime = networkTime - parseInt(spReqDuration, 10);
  + if (spReqDuration !== undefined && networkTimeBrowser !== undefined) {
  + networkTimeBrowser = networkTimeBrowser - parseInt(spReqDuration, 10);
  }
  break;
  }
  @@ -411,6 +414,7 @@ async function fetchLatestSnapshotCore(
  putInCache(valueWithEpoch);
  }
  + const parseTime = snapshotParseEvent.duration;
  snapshotParseEvent.end();
  event.end({
  @@ -440,12 +444,18 @@ async function fetchLatestSnapshotCore(
  reqStartToResponseEndTime,
  // Interval between starting the request for the resource until receiving the last byte but
  // excluding the Snaphot request duration indicated on the snapshot response header.
  - networkTime,
  + networkTimeBrowser,
  + // Similar to networkTime, but measured from within JS code. There is data suggesting that
  + // networkTime is wrong - see ADO #2530 for more details.
  + networkTimeJs,
  // Sharing link telemetry regarding sharing link redeem status and performance. Ex: FRL; dur=100,
  // Azure Fluid Relay service; desc=S, FRP; desc=False. Here, FRL is the duration taken for redeem,
  // Azure Fluid Relay service is the redeem status (S means success), and FRP is a flag to indicate
  // if the permission has changed.
  sltelemetry: odspResponse.headers.get("x-fluid-sltelemetry"),
  + // time it takes client to parse payload. Same payload as in "SnapshotParse" event, here for
  + // easier analyzes.
  + parseTime,
  ...propsToLog,
  });
  return snapshot;
  