@sentry/ember 11.0.0-alpha.0 → 11.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,13 +15,10 @@ type Payload = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
type RenderEntry = {
|
|
18
|
-
payload: Payload;
|
|
19
18
|
now: number;
|
|
20
19
|
};
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
[name: string]: RenderEntry;
|
|
24
|
-
}
|
|
21
|
+
export type RenderEntries = WeakMap<Payload, RenderEntry>;
|
|
25
22
|
|
|
26
23
|
/** This is global, so should only be run once in tests! */
|
|
27
24
|
export function instrumentGlobalsForPerformance(config: {
|
|
@@ -127,26 +124,26 @@ function _instrumentEmberRunloop(config: { minimumRunloopQueueDuration?: number
|
|
|
127
124
|
});
|
|
128
125
|
}
|
|
129
126
|
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
payload,
|
|
133
|
-
now: timestampInSeconds(),
|
|
134
|
-
};
|
|
135
|
-
beforeEntries[payload.object] = info;
|
|
127
|
+
export function _processComponentRenderBefore(payload: Payload, beforeEntries: RenderEntries): void {
|
|
128
|
+
beforeEntries.set(payload, { now: timestampInSeconds() });
|
|
136
129
|
}
|
|
137
130
|
|
|
138
|
-
function
|
|
131
|
+
export function _processComponentRenderAfter(
|
|
139
132
|
payload: Payload,
|
|
140
133
|
beforeEntries: RenderEntries,
|
|
141
134
|
op: string,
|
|
142
135
|
minComponentDuration: number,
|
|
143
136
|
): void {
|
|
144
|
-
const begin = beforeEntries
|
|
137
|
+
const begin = beforeEntries.get(payload);
|
|
145
138
|
|
|
146
139
|
if (!begin) {
|
|
147
140
|
return;
|
|
148
141
|
}
|
|
149
142
|
|
|
143
|
+
// A WeakMap entry cannot outlive its payload, but delete promptly anyway
|
|
144
|
+
// so a long-lived payload doesn't keep the entry around between renders.
|
|
145
|
+
beforeEntries.delete(payload);
|
|
146
|
+
|
|
150
147
|
const now = timestampInSeconds();
|
|
151
148
|
const componentRenderDuration = now - begin.now;
|
|
152
149
|
|
|
@@ -174,27 +171,27 @@ function _instrumentComponents(config: {
|
|
|
174
171
|
|
|
175
172
|
const minComponentDuration = minimumComponentRenderDuration ?? 2;
|
|
176
173
|
|
|
177
|
-
const beforeEntries =
|
|
178
|
-
const beforeComponentDefinitionEntries =
|
|
174
|
+
const beforeEntries: RenderEntries = new WeakMap();
|
|
175
|
+
const beforeComponentDefinitionEntries: RenderEntries = new WeakMap();
|
|
179
176
|
|
|
180
177
|
function _subscribeToRenderEvents(): void {
|
|
181
178
|
subscribe('render.component', {
|
|
182
179
|
before(_name: string, _timestamp: number, payload: Payload) {
|
|
183
|
-
|
|
180
|
+
_processComponentRenderBefore(payload, beforeEntries);
|
|
184
181
|
},
|
|
185
182
|
|
|
186
183
|
after(_name: string, _timestamp: number, payload: Payload, _beganIndex: number) {
|
|
187
|
-
|
|
184
|
+
_processComponentRenderAfter(payload, beforeEntries, BROWSER_UI_RENDER_SPAN_OP, minComponentDuration);
|
|
188
185
|
},
|
|
189
186
|
});
|
|
190
187
|
if (enableComponentDefinitions) {
|
|
191
188
|
subscribe('render.getComponentDefinition', {
|
|
192
189
|
before(_name: string, _timestamp: number, payload: Payload) {
|
|
193
|
-
|
|
190
|
+
_processComponentRenderBefore(payload, beforeComponentDefinitionEntries);
|
|
194
191
|
},
|
|
195
192
|
|
|
196
193
|
after(_name: string, _timestamp: number, payload: Payload, _beganIndex: number) {
|
|
197
|
-
|
|
194
|
+
_processComponentRenderAfter(payload, beforeComponentDefinitionEntries, GENERAL_FUNCTION_SPAN_OP, 0);
|
|
198
195
|
},
|
|
199
196
|
});
|
|
200
197
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/ember",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.1",
|
|
4
4
|
"description": "Official Sentry SDK for Ember.js",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/core": "^7.29.6",
|
|
34
34
|
"@embroider/macros": "^1.16.0",
|
|
35
|
-
"@sentry/browser": "11.0.0-alpha.
|
|
36
|
-
"@sentry/core": "11.0.0-alpha.
|
|
37
|
-
"@sentry/conventions": "^0.
|
|
35
|
+
"@sentry/browser": "11.0.0-alpha.1",
|
|
36
|
+
"@sentry/core": "11.0.0-alpha.1",
|
|
37
|
+
"@sentry/conventions": "^0.19.0",
|
|
38
38
|
"ember-auto-import": "^2.7.2",
|
|
39
39
|
"ember-cli-babel": "^8.2.0",
|
|
40
40
|
"ember-cli-htmlbars": "^6.1.1",
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
type Payload = {
|
|
2
|
+
containerKey: string;
|
|
3
|
+
initialRender: true;
|
|
4
|
+
object: string;
|
|
5
|
+
};
|
|
6
|
+
type RenderEntry = {
|
|
7
|
+
now: number;
|
|
8
|
+
};
|
|
9
|
+
export type RenderEntries = WeakMap<Payload, RenderEntry>;
|
|
1
10
|
/** This is global, so should only be run once in tests! */
|
|
2
11
|
export declare function instrumentGlobalsForPerformance(config: {
|
|
3
12
|
disableRunloopPerformance?: boolean;
|
|
@@ -7,3 +16,6 @@ export declare function instrumentGlobalsForPerformance(config: {
|
|
|
7
16
|
enableComponentDefinitions?: boolean;
|
|
8
17
|
disableInitialLoadInstrumentation?: boolean;
|
|
9
18
|
}): void;
|
|
19
|
+
export declare function _processComponentRenderBefore(payload: Payload, beforeEntries: RenderEntries): void;
|
|
20
|
+
export declare function _processComponentRenderAfter(payload: Payload, beforeEntries: RenderEntries, op: string, minComponentDuration: number): void;
|
|
21
|
+
export {};
|