Skip to content

Commit 22f191f

Browse files
feat(core): extend the set of profiler events (angular#59183)
This commit extends the set of events understood by the profiler integrated with the Angular time. The set got extended to account for the recently added functionality and mark entry point to the code execution points. The new set of events can be visualised by the Angular DevTools or other profiler integrations. PR Close angular#59183
1 parent c181903 commit 22f191f

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed

devtools/projects/ng-devtools-backend/src/lib/hooks/profiler/native.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,96 @@ export class NgProfiler extends Profiler {
7474
});
7575
}
7676

77+
[ɵProfilerEvent.BootstrapApplicationStart](_directive: any, _hookOrListener: any): void {
78+
// todo: implement
79+
return;
80+
}
81+
82+
[ɵProfilerEvent.BootstrapApplicationEnd](_directive: any, _hookOrListener: any): void {
83+
// todo: implement
84+
return;
85+
}
86+
87+
[ɵProfilerEvent.BootstrapComponentStart](_directive: any, _hookOrListener: any): void {
88+
// todo: implement
89+
return;
90+
}
91+
92+
[ɵProfilerEvent.BootstrapComponentEnd](_directive: any, _hookOrListener: any): void {
93+
// todo: implement
94+
return;
95+
}
96+
97+
[ɵProfilerEvent.ChangeDetectionStart](_directive: any, _hookOrListener: any): void {
98+
// todo: implement
99+
return;
100+
}
101+
102+
[ɵProfilerEvent.ChangeDetectionEnd](_directive: any, _hookOrListener: any): void {
103+
// todo: implement
104+
return;
105+
}
106+
107+
[ɵProfilerEvent.ChangeDetectionSyncStart](_directive: any, _hookOrListener: any): void {
108+
// todo: implement
109+
return;
110+
}
111+
112+
[ɵProfilerEvent.ChangeDetectionSyncEnd](_directive: any, _hookOrListener: any): void {
113+
// todo: implement
114+
return;
115+
}
116+
117+
[ɵProfilerEvent.AfterRenderHooksStart](_directive: any, _hookOrListener: any): void {
118+
// todo: implement
119+
return;
120+
}
121+
122+
[ɵProfilerEvent.AfterRenderHooksEnd](_directive: any, _hookOrListener: any): void {
123+
// todo: implement
124+
return;
125+
}
126+
127+
[ɵProfilerEvent.ComponentStart](_directive: any, _hookOrListener: any): void {
128+
// todo: implement
129+
return;
130+
}
131+
132+
[ɵProfilerEvent.ComponentEnd](_directive: any, _hookOrListener: any): void {
133+
// todo: implement
134+
return;
135+
}
136+
137+
[ɵProfilerEvent.DeferBlockStateStart](_directive: any, _hookOrListener: any): void {
138+
// todo: implement
139+
return;
140+
}
141+
142+
[ɵProfilerEvent.DeferBlockStateEnd](_directive: any, _hookOrListener: any): void {
143+
// todo: implement
144+
return;
145+
}
146+
147+
[ɵProfilerEvent.DynamicComponentStart](_directive: any, _hookOrListener: any): void {
148+
// todo: implement
149+
return;
150+
}
151+
152+
[ɵProfilerEvent.DynamicComponentEnd](_directive: any, _hookOrListener: any): void {
153+
// todo: implement
154+
return;
155+
}
156+
157+
[ɵProfilerEvent.HostBindingsUpdateStart](_directive: any, _hookOrListener: any): void {
158+
// todo: implement
159+
return;
160+
}
161+
162+
[ɵProfilerEvent.HostBindingsUpdateEnd](_directive: any, _hookOrListener: any): void {
163+
// todo: implement
164+
return;
165+
}
166+
77167
[ɵProfilerEvent.TemplateCreateStart](_directive: any, _hookOrListener: any): void {
78168
// todo: implement
79169
return;

packages/core/src/render3/profiler_types.ts

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,98 @@ export const enum ProfilerEvent {
6262
* an event or an output.
6363
*/
6464
OutputEnd,
65+
66+
/**
67+
* Corresponds to the point in time just before application bootstrap.
68+
*/
69+
BootstrapApplicationStart,
70+
71+
/**
72+
* Corresponds to the point in time after application bootstrap.
73+
*/
74+
BootstrapApplicationEnd,
75+
76+
/**
77+
* Corresponds to the point in time just before root component bootstrap.
78+
*/
79+
BootstrapComponentStart,
80+
81+
/**
82+
* Corresponds to the point in time after root component bootstrap.
83+
*/
84+
BootstrapComponentEnd,
85+
86+
/**
87+
* Corresponds to the point in time just before Angular starts a change detection tick.
88+
*/
89+
ChangeDetectionStart,
90+
91+
/**
92+
* Corresponds to the point in time after Angular ended a change detection tick.
93+
*/
94+
ChangeDetectionEnd,
95+
96+
/**
97+
* Corresponds to the point in time just before Angular starts a new synchronization pass of change detection tick.
98+
*/
99+
ChangeDetectionSyncStart,
100+
101+
/**
102+
* Corresponds to the point in time after Angular ended a synchronization pass.
103+
*/
104+
ChangeDetectionSyncEnd,
105+
106+
/**
107+
* Corresponds to the point in time just before Angular executes after render hooks.
108+
*/
109+
AfterRenderHooksStart,
110+
111+
/**
112+
* Corresponds to the point in time after Angular executed after render hooks.
113+
*/
114+
AfterRenderHooksEnd,
115+
116+
/**
117+
* Corresponds to the point in time just before Angular starts processing a component (create or update).
118+
*/
119+
ComponentStart,
120+
121+
/**
122+
* Corresponds to the point in time after Angular finished processing a component.
123+
*/
124+
ComponentEnd,
125+
126+
/**
127+
* Corresponds to the point in time just before a defer block transitions between states.
128+
*/
129+
DeferBlockStateStart,
130+
131+
/**
132+
* Corresponds to the point in time after a defer block transitioned between states.
133+
*/
134+
DeferBlockStateEnd,
135+
136+
/**
137+
* Corresponds to the point in time just before a component instance is created dynamically.
138+
*/
139+
DynamicComponentStart,
140+
141+
/**
142+
* Corresponds to the point in time after a a component instance is created dynamically.
143+
*/
144+
DynamicComponentEnd,
145+
146+
/**
147+
* Corresponds to the point in time before the runtime has called the host bindings function
148+
* of a directive.
149+
*/
150+
HostBindingsUpdateStart,
151+
152+
/**
153+
* Corresponds to the point in time after the runtime has called the host bindings function
154+
* of a directive.
155+
*/
156+
HostBindingsUpdateEnd,
65157
}
66158

67159
/**

0 commit comments

Comments
 (0)