Skip to content

Commit b8863ce

Browse files
committed
Include env in performance track if different
1 parent aa76650 commit b8863ce

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/react-client/src/ReactFlightClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,7 +2769,7 @@ function initializeIOInfo(response: Response, ioInfo: ReactIOInfo): void {
27692769
// $FlowFixMe[cannot-write]
27702770
ioInfo.end += response._timeOrigin;
27712771

2772-
logIOInfo(ioInfo);
2772+
logIOInfo(ioInfo, response._rootEnvironmentName);
27732773
}
27742774

27752775
function resolveIOInfo(

packages/react-client/src/ReactFlightPerformanceTrack.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,23 @@ function getIOColor(
220220
}
221221
}
222222

223-
export function logIOInfo(ioInfo: ReactIOInfo): void {
223+
export function logIOInfo(ioInfo: ReactIOInfo, rootEnv: string): void {
224224
const startTime = ioInfo.start;
225225
const endTime = ioInfo.end;
226226
if (supportsUserTiming && endTime >= 0) {
227227
const name = ioInfo.name;
228+
const env = ioInfo.env;
229+
const isPrimaryEnv = env === rootEnv;
230+
const entryName =
231+
isPrimaryEnv || env === undefined ? name : name + ' [' + env + ']';
228232
const debugTask = ioInfo.debugTask;
229233
const color = getIOColor(name);
230234
if (__DEV__ && debugTask) {
231235
debugTask.run(
232236
// $FlowFixMe[method-unbinding]
233237
console.timeStamp.bind(
234238
console,
235-
name,
239+
entryName,
236240
startTime < 0 ? 0 : startTime,
237241
endTime,
238242
IO_TRACK,
@@ -242,7 +246,7 @@ export function logIOInfo(ioInfo: ReactIOInfo): void {
242246
);
243247
} else {
244248
console.timeStamp(
245-
name,
249+
entryName,
246250
startTime < 0 ? 0 : startTime,
247251
endTime,
248252
IO_TRACK,

0 commit comments

Comments
 (0)