Skip to content

Commit 7254489

Browse files
committed
Include env in performance track if different
1 parent 0e43943 commit 7254489

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
@@ -224,19 +224,23 @@ function getIOColor(
224224
}
225225
}
226226

227-
export function logIOInfo(ioInfo: ReactIOInfo): void {
227+
export function logIOInfo(ioInfo: ReactIOInfo, rootEnv: string): void {
228228
const startTime = ioInfo.start;
229229
const endTime = ioInfo.end;
230230
if (supportsUserTiming && endTime >= 0) {
231231
const name = ioInfo.name;
232+
const env = ioInfo.env;
233+
const isPrimaryEnv = env === rootEnv;
234+
const entryName =
235+
isPrimaryEnv || env === undefined ? name : name + ' [' + env + ']';
232236
const debugTask = ioInfo.debugTask;
233237
const color = getIOColor(name);
234238
if (__DEV__ && debugTask) {
235239
debugTask.run(
236240
// $FlowFixMe[method-unbinding]
237241
console.timeStamp.bind(
238242
console,
239-
name,
243+
entryName,
240244
startTime < 0 ? 0 : startTime,
241245
endTime,
242246
IO_TRACK,
@@ -246,7 +250,7 @@ export function logIOInfo(ioInfo: ReactIOInfo): void {
246250
);
247251
} else {
248252
console.timeStamp(
249-
name,
253+
entryName,
250254
startTime < 0 ? 0 : startTime,
251255
endTime,
252256
IO_TRACK,

0 commit comments

Comments
 (0)