Start
Interval
Delta
@@ -137,25 +143,25 @@ function ServerTrace({ trace }: ServerTraceProps) {
return (
-
+
{lines.map(line => (
{line}
))}
-
+
);
}
function TTIAnalytics() {
const analytics = TTITracker.serializeTTITracker();
- const filteredAnalytics = Object.entries(analytics).filter(([key, value]) => !/_start$|_end$/.test(key) && value !== null && value !== undefined);
+ const filteredAnalytics = Object.entries(analytics).filter(([key, value]) => value != null && !/_start$|_end$/.test(key));
return (
-
+
{filteredAnalytics.map(([key, value]) => (
{key}
@@ -169,45 +175,26 @@ function TTIAnalytics() {
);
}
-function TTITimings() {
- const records: [string, ITTITrackerEvent][] = (Object.entries(TTITracker) as [string, ITTITrackerEvent][])
- .filter(([, value]) => value instanceof Object && value.hasData?.()) as any;
+interface TTITimingsProps {
+ records: [string, ITTITrackerEvent][];
+ title: string;
+ type: "registered" | "unregistered";
+}
+
+function TTITimings({ records, title, type }: TTITimingsProps) {
+ const isRegistered = type === "registered";
return (
-
+
-
-
Duration
+
+ {isRegistered &&
Duration}
Key
Event
{records.map(([key, event]) => (
-
- {event.end - event.start}ms
- {key}
- {event.emoji} {event.name}
-
- ))}
-
-
-
-
- );
-}
-
-function UnregisteredTimings() {
- const records: [string, ITTITrackerEvent][] = (Object.entries(TTITracker) as [string, ITTITrackerEvent][])
- .filter(([, value]) => value instanceof Object && value.hasData && !value.hasData()) as any;
-
- return (
-
-
-
-
-
Key
-
Name
- {records.map(([key, event]) => (
-
+
+ {isRegistered && {event.end - event.start}ms
}
{key}
{event.emoji} {event.name}
@@ -224,6 +211,12 @@ function StartupTimingPage() {
const serverTrace = AppStartPerformance.logGroups.find(g => g.serverTrace)?.serverTrace;
+ const registeredTTITimings: [string, ITTITrackerEvent][] = (Object.entries(TTITracker))
+ .filter(([, value]) => value?.hasData?.());
+
+ const unregisteredTTITimings: [string, ITTITrackerEvent][] = (Object.entries(TTITracker))
+ .filter(([, value]) => value?.hasData && !value.hasData());
+
return (
-
+
-
+
);
}