@forgeax/engine-profiler 0.1.2
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.
- package/LICENSE +202 -0
- package/README.md +164 -0
- package/bin/forgeax-engine-profiler.mjs +5 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/browser-profile-detail-owner.test-d.d.ts +2 -0
- package/dist/__tests__/browser-profile-detail-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/browser-user-timing.test.d.ts +2 -0
- package/dist/__tests__/browser-user-timing.test.d.ts.map +1 -0
- package/dist/__tests__/cli-consumer.integration.test.d.ts +2 -0
- package/dist/__tests__/cli-consumer.integration.test.d.ts.map +1 -0
- package/dist/__tests__/cli-contract.test.d.ts +2 -0
- package/dist/__tests__/cli-contract.test.d.ts.map +1 -0
- package/dist/__tests__/cli-input-errors.test.d.ts +2 -0
- package/dist/__tests__/cli-input-errors.test.d.ts.map +1 -0
- package/dist/__tests__/cli-process.integration.test.d.ts +2 -0
- package/dist/__tests__/cli-process.integration.test.d.ts.map +1 -0
- package/dist/__tests__/compare.test.d.ts +2 -0
- package/dist/__tests__/compare.test.d.ts.map +1 -0
- package/dist/__tests__/comparison-side-owner.test-d.d.ts +2 -0
- package/dist/__tests__/comparison-side-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/consumer-smoke.integration.test.d.ts +2 -0
- package/dist/__tests__/consumer-smoke.integration.test.d.ts.map +1 -0
- package/dist/__tests__/generated-freshness.test.d.ts +2 -0
- package/dist/__tests__/generated-freshness.test.d.ts.map +1 -0
- package/dist/__tests__/model-determinism.test.d.ts +2 -0
- package/dist/__tests__/model-determinism.test.d.ts.map +1 -0
- package/dist/__tests__/model-query.test.d.ts +2 -0
- package/dist/__tests__/model-query.test.d.ts.map +1 -0
- package/dist/__tests__/overflow-long-tail.test.d.ts +2 -0
- package/dist/__tests__/overflow-long-tail.test.d.ts.map +1 -0
- package/dist/__tests__/profile-source-owner.test-d.d.ts +2 -0
- package/dist/__tests__/profile-source-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/profiler-error-owner.test-d.d.ts +2 -0
- package/dist/__tests__/profiler-error-owner.test-d.d.ts.map +1 -0
- package/dist/__tests__/published-entry.browser.test.d.ts +2 -0
- package/dist/__tests__/published-entry.browser.test.d.ts.map +1 -0
- package/dist/__tests__/recorder-contract.test.d.ts +2 -0
- package/dist/__tests__/recorder-contract.test.d.ts.map +1 -0
- package/dist/__tests__/schema-contract.test.d.ts +2 -0
- package/dist/__tests__/schema-contract.test.d.ts.map +1 -0
- package/dist/__tests__/schema-derived-union-owner.test.d.ts +2 -0
- package/dist/__tests__/schema-derived-union-owner.test.d.ts.map +1 -0
- package/dist/browser-user-timing.d.ts +24 -0
- package/dist/browser-user-timing.d.ts.map +1 -0
- package/dist/browser-user-timing.mjs +140 -0
- package/dist/browser-user-timing.mjs.map +1 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.mjs +7783 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/clock.d.ts +5 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/compare.d.ts +42 -0
- package/dist/compare.d.ts.map +1 -0
- package/dist/errors.d.ts +64 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/generated/profile-capture.d.ts +44 -0
- package/dist/generated/profile-capture.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +8111 -0
- package/dist/index.mjs.map +1 -0
- package/dist/model.d.ts +44 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/profiler.d.ts +24 -0
- package/dist/profiler.d.ts.map +1 -0
- package/dist/recorder.d.ts +26 -0
- package/dist/recorder.d.ts.map +1 -0
- package/dist/schema.d.ts +13 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/tool-preview-profile.d.ts +33 -0
- package/dist/tool-preview-profile.d.ts.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +76 -0
- package/schema/profile-capture.schema.json +71 -0
- package/scripts/consume-smoke.mjs +17 -0
- package/scripts/generate-profile-types.mjs +75 -0
- package/src/__tests__/browser-profile-detail-owner.test-d.ts +26 -0
- package/src/__tests__/browser-user-timing.test.ts +127 -0
- package/src/__tests__/cli-consumer.integration.test.ts +113 -0
- package/src/__tests__/cli-contract.test.ts +115 -0
- package/src/__tests__/cli-input-errors.test.ts +210 -0
- package/src/__tests__/cli-process.integration.test.ts +154 -0
- package/src/__tests__/compare.test.ts +223 -0
- package/src/__tests__/comparison-side-owner.test-d.ts +28 -0
- package/src/__tests__/consumer-smoke.integration.test.ts +37 -0
- package/src/__tests__/fixtures/cli/invalid-version.json +18 -0
- package/src/__tests__/fixtures/cli/partial-capture.json +28 -0
- package/src/__tests__/fixtures/cli/valid-capture.json +43 -0
- package/src/__tests__/fixtures/profile-capture/invalid-boundary.json +144 -0
- package/src/__tests__/fixtures/profile-capture/model-input.json +54 -0
- package/src/__tests__/fixtures/profile-capture/sink-failure.json +30 -0
- package/src/__tests__/fixtures/profile-capture/valid-complete.json +43 -0
- package/src/__tests__/fixtures/profile-capture/valid-overflow.json +45 -0
- package/src/__tests__/generated-freshness.test.ts +14 -0
- package/src/__tests__/model-determinism.test.ts +70 -0
- package/src/__tests__/model-query.test.ts +128 -0
- package/src/__tests__/overflow-long-tail.test.ts +131 -0
- package/src/__tests__/profile-source-owner.test-d.ts +45 -0
- package/src/__tests__/profiler-error-owner.test-d.ts +64 -0
- package/src/__tests__/published-entry.browser.test.ts +27 -0
- package/src/__tests__/recorder-contract.test.ts +163 -0
- package/src/__tests__/schema-contract.test.ts +42 -0
- package/src/__tests__/schema-derived-union-owner.test.ts +57 -0
- package/src/browser-user-timing.ts +194 -0
- package/src/cli.ts +425 -0
- package/src/clock.ts +18 -0
- package/src/compare.ts +159 -0
- package/src/errors.ts +78 -0
- package/src/generated/profile-capture.ts +48 -0
- package/src/index.ts +54 -0
- package/src/model.ts +161 -0
- package/src/profiler.ts +201 -0
- package/src/recorder.ts +417 -0
- package/src/schema.ts +168 -0
- package/src/tool-preview-profile.ts +67 -0
- package/src/types.ts +56 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { compareProfileCaptures } from '../compare.js';
|
|
4
|
+
|
|
5
|
+
function readFixture(name: string): unknown {
|
|
6
|
+
return JSON.parse(
|
|
7
|
+
readFileSync(new URL(`./fixtures/cli/${name}`, import.meta.url), 'utf8'),
|
|
8
|
+
) as unknown;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function capture(variant: 'left' | 'right'): Record<string, unknown> {
|
|
12
|
+
const right = variant === 'right';
|
|
13
|
+
return {
|
|
14
|
+
schemaVersion: '1.0',
|
|
15
|
+
captureId: right ? 'capture-0002' : 'capture-0001',
|
|
16
|
+
timeUnit: 'microseconds',
|
|
17
|
+
frameLimit: 4,
|
|
18
|
+
eventLimit: 16,
|
|
19
|
+
phaseCatalog: {
|
|
20
|
+
app: ['input', 'update'],
|
|
21
|
+
render: right ? ['submit', 'gpu'] : ['submit'],
|
|
22
|
+
},
|
|
23
|
+
records: right
|
|
24
|
+
? [
|
|
25
|
+
{
|
|
26
|
+
kind: 'phase',
|
|
27
|
+
source: 'app',
|
|
28
|
+
frameId: 1,
|
|
29
|
+
phase: 'input',
|
|
30
|
+
startMicros: 1,
|
|
31
|
+
endMicros: 16,
|
|
32
|
+
durationMicros: 15,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
kind: 'phase',
|
|
36
|
+
source: 'app',
|
|
37
|
+
frameId: 1,
|
|
38
|
+
phase: 'update',
|
|
39
|
+
parentSource: 'app',
|
|
40
|
+
parentPhase: 'input',
|
|
41
|
+
startMicros: 16,
|
|
42
|
+
endMicros: 41,
|
|
43
|
+
durationMicros: 25,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
kind: 'phase',
|
|
47
|
+
source: 'render',
|
|
48
|
+
frameId: 1,
|
|
49
|
+
phase: 'submit',
|
|
50
|
+
startMicros: 41,
|
|
51
|
+
endMicros: 46,
|
|
52
|
+
durationMicros: 5,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
kind: 'phase',
|
|
56
|
+
source: 'render',
|
|
57
|
+
frameId: 2,
|
|
58
|
+
phase: 'gpu',
|
|
59
|
+
startMicros: 50,
|
|
60
|
+
endMicros: 90,
|
|
61
|
+
durationMicros: 40,
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
: [
|
|
65
|
+
{
|
|
66
|
+
kind: 'phase',
|
|
67
|
+
source: 'app',
|
|
68
|
+
frameId: 1,
|
|
69
|
+
phase: 'input',
|
|
70
|
+
startMicros: 1,
|
|
71
|
+
endMicros: 11,
|
|
72
|
+
durationMicros: 10,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
kind: 'phase',
|
|
76
|
+
source: 'app',
|
|
77
|
+
frameId: 1,
|
|
78
|
+
phase: 'update',
|
|
79
|
+
parentSource: 'app',
|
|
80
|
+
parentPhase: 'input',
|
|
81
|
+
startMicros: 11,
|
|
82
|
+
endMicros: 31,
|
|
83
|
+
durationMicros: 20,
|
|
84
|
+
},
|
|
85
|
+
{ kind: 'skip', source: 'render', frameId: 1, phase: 'submit', reason: 'not recorded' },
|
|
86
|
+
],
|
|
87
|
+
completeness: right
|
|
88
|
+
? {
|
|
89
|
+
status: 'overflow',
|
|
90
|
+
retainedEventCount: 4,
|
|
91
|
+
droppedEventCount: 2,
|
|
92
|
+
firstAffectedFrameId: 2,
|
|
93
|
+
lastAffectedFrameId: 2,
|
|
94
|
+
}
|
|
95
|
+
: { status: 'complete', retainedEventCount: 3, droppedEventCount: 0 },
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
describe('ProfileCapture comparison', () => {
|
|
100
|
+
it('preserves both summaries and compares a union of full phase identities', () => {
|
|
101
|
+
const result = compareProfileCaptures(capture('left'), capture('right'));
|
|
102
|
+
|
|
103
|
+
expect(result.ok).toBe(true);
|
|
104
|
+
if (!result.ok) throw new Error(result.error.code);
|
|
105
|
+
expect(result.value.left).toMatchObject({
|
|
106
|
+
summary: {
|
|
107
|
+
captureId: 'capture-0001',
|
|
108
|
+
frameCount: 1,
|
|
109
|
+
recordCount: 3,
|
|
110
|
+
phaseCount: 2,
|
|
111
|
+
skipCount: 1,
|
|
112
|
+
},
|
|
113
|
+
completeness: { status: 'complete', retainedEventCount: 3, droppedEventCount: 0 },
|
|
114
|
+
});
|
|
115
|
+
expect(result.value.right).toMatchObject({
|
|
116
|
+
summary: { captureId: 'capture-0002' },
|
|
117
|
+
completeness: {
|
|
118
|
+
status: 'overflow',
|
|
119
|
+
retainedEventCount: 4,
|
|
120
|
+
droppedEventCount: 2,
|
|
121
|
+
firstAffectedFrameId: 2,
|
|
122
|
+
lastAffectedFrameId: 2,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const update = result.value.phases.find((phase) => phase.identity.phase === 'update');
|
|
127
|
+
expect(update).toEqual({
|
|
128
|
+
identity: { source: 'app', phase: 'update', parentSource: 'app', parentPhase: 'input' },
|
|
129
|
+
left: { count: 1, skipCount: 0, p95DurationMicros: 20 },
|
|
130
|
+
right: { count: 1, skipCount: 0, p95DurationMicros: 25 },
|
|
131
|
+
delta: { count: 0, skipCount: 0, p95DurationMicros: 5 },
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const submit = result.value.phases.find(
|
|
135
|
+
(phase) => phase.identity.source === 'render' && phase.identity.phase === 'submit',
|
|
136
|
+
);
|
|
137
|
+
expect(submit).toEqual({
|
|
138
|
+
identity: { source: 'render', phase: 'submit' },
|
|
139
|
+
left: { count: 0, skipCount: 1, p95DurationMicros: null },
|
|
140
|
+
right: { count: 1, skipCount: 0, p95DurationMicros: 5 },
|
|
141
|
+
delta: { count: 1, skipCount: -1 },
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const gpu = result.value.phases.find((phase) => phase.identity.phase === 'gpu');
|
|
145
|
+
expect(gpu).toEqual({
|
|
146
|
+
identity: { source: 'render', phase: 'gpu' },
|
|
147
|
+
right: { count: 1, skipCount: 0, p95DurationMicros: 40 },
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('keeps invalid input attributable to its side', () => {
|
|
152
|
+
const left = compareProfileCaptures({ schemaVersion: '9.0' }, capture('right'));
|
|
153
|
+
expect(left).toEqual({
|
|
154
|
+
ok: false,
|
|
155
|
+
error: {
|
|
156
|
+
code: 'profile-artifact-incompatible',
|
|
157
|
+
expected: expect.any(String),
|
|
158
|
+
hint: expect.any(String),
|
|
159
|
+
detail: {
|
|
160
|
+
path: '/schemaVersion',
|
|
161
|
+
message: expect.any(String),
|
|
162
|
+
side: 'left',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const right = compareProfileCaptures(capture('left'), { schemaVersion: '9.0' });
|
|
168
|
+
expect(right).toMatchObject({ ok: false, error: { detail: { side: 'right' } } });
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('does not mutate either artifact and produces stable ordering', () => {
|
|
172
|
+
const left = capture('left');
|
|
173
|
+
const right = capture('right');
|
|
174
|
+
const beforeLeft = JSON.stringify(left);
|
|
175
|
+
const beforeRight = JSON.stringify(right);
|
|
176
|
+
const first = compareProfileCaptures(left, right);
|
|
177
|
+
const second = compareProfileCaptures(left, right);
|
|
178
|
+
|
|
179
|
+
expect(first).toEqual(second);
|
|
180
|
+
expect(JSON.stringify(left)).toBe(beforeLeft);
|
|
181
|
+
expect(JSON.stringify(right)).toBe(beforeRight);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('keeps an unavailable p95 unavailable instead of manufacturing a delta', () => {
|
|
185
|
+
const result = compareProfileCaptures(
|
|
186
|
+
readFixture('valid-capture.json'),
|
|
187
|
+
readFixture('partial-capture.json'),
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
expect(result.ok).toBe(true);
|
|
191
|
+
if (!result.ok) throw new Error(result.error.code);
|
|
192
|
+
const input = result.value.phases.find(
|
|
193
|
+
(phase) => phase.identity.source === 'app' && phase.identity.phase === 'input',
|
|
194
|
+
);
|
|
195
|
+
expect(input?.left?.p95DurationMicros).toBe(10);
|
|
196
|
+
expect(input?.right?.p95DurationMicros).toBe(15);
|
|
197
|
+
expect(input?.delta?.p95DurationMicros).toBe(5);
|
|
198
|
+
const update = result.value.phases.find(
|
|
199
|
+
(phase) => phase.identity.source === 'app' && phase.identity.phase === 'update',
|
|
200
|
+
);
|
|
201
|
+
expect(update?.left?.p95DurationMicros).toBe(30);
|
|
202
|
+
expect(update?.right).toBeUndefined();
|
|
203
|
+
expect(update?.delta).toBeUndefined();
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('does not merge equal phase names that have different parent identities', () => {
|
|
207
|
+
const right = capture('right');
|
|
208
|
+
const rootUpdate = (right.records as Array<Record<string, unknown>>).map((record) => {
|
|
209
|
+
if (record.phase !== 'update') return record;
|
|
210
|
+
const { parentSource: _parentSource, parentPhase: _parentPhase, ...withoutParent } = record;
|
|
211
|
+
return withoutParent;
|
|
212
|
+
});
|
|
213
|
+
const result = compareProfileCaptures(capture('left'), { ...right, records: rootUpdate });
|
|
214
|
+
|
|
215
|
+
expect(result.ok).toBe(true);
|
|
216
|
+
if (!result.ok) throw new Error(result.error.code);
|
|
217
|
+
const updates = result.value.phases.filter((phase) => phase.identity.phase === 'update');
|
|
218
|
+
expect(updates).toHaveLength(2);
|
|
219
|
+
expect(updates.map((phase) => phase.identity.parentPhase)).toEqual(['input', undefined]);
|
|
220
|
+
expect(updates[0]?.delta).toBeUndefined();
|
|
221
|
+
expect(updates[1]?.delta).toBeUndefined();
|
|
222
|
+
});
|
|
223
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { describe, expect, expectTypeOf, it } from 'vitest';
|
|
3
|
+
import type { ProfileComparisonError } from '../index.js';
|
|
4
|
+
|
|
5
|
+
type ComparisonErrorSide = ProfileComparisonError['detail']['side'];
|
|
6
|
+
type ExpectedComparisonErrorSide = 'left' | 'right';
|
|
7
|
+
|
|
8
|
+
const compareSource = readFileSync(new URL('../compare.ts', import.meta.url), 'utf8');
|
|
9
|
+
|
|
10
|
+
describe('profile comparison side owner', () => {
|
|
11
|
+
it('keeps the public side vocabulary bilaterally exact', () => {
|
|
12
|
+
expectTypeOf<ComparisonErrorSide>().toEqualTypeOf<ExpectedComparisonErrorSide>();
|
|
13
|
+
expectTypeOf<ExpectedComparisonErrorSide>().toEqualTypeOf<ComparisonErrorSide>();
|
|
14
|
+
|
|
15
|
+
const acceptsSide = (side: ComparisonErrorSide): void => void side;
|
|
16
|
+
acceptsSide('left');
|
|
17
|
+
acceptsSide('right');
|
|
18
|
+
// @ts-expect-error Unknown sides remain outside the public comparison vocabulary.
|
|
19
|
+
acceptsSide('comparison-side-not-real');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('derives withSide from the public error detail owner', () => {
|
|
23
|
+
expect(compareSource).toContain("side: ProfileComparisonError['detail']['side'],");
|
|
24
|
+
expect(compareSource).not.toContain("side: 'left' | 'right'");
|
|
25
|
+
expect(compareSource).toContain("withSide('left', leftModel.error)");
|
|
26
|
+
expect(compareSource).toContain("withSide('right', rightModel.error)");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
import { buildProfileModel } from '@forgeax/engine-profiler';
|
|
6
|
+
import { describe, expect, it } from 'vitest';
|
|
7
|
+
|
|
8
|
+
// @perf-budget-skip: intentional public-entry subprocess smoke gate.
|
|
9
|
+
const packageRoot = fileURLToPath(new URL('../../', import.meta.url));
|
|
10
|
+
const scriptPath = fileURLToPath(new URL('../../scripts/consume-smoke.mjs', import.meta.url));
|
|
11
|
+
const fixturePath = fileURLToPath(
|
|
12
|
+
new URL('./fixtures/profile-capture/model-input.json', import.meta.url),
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
describe('consumer smoke', () => {
|
|
16
|
+
it('consumes a fixture through the public package entry', () => {
|
|
17
|
+
const result = spawnSync(process.execPath, [scriptPath], {
|
|
18
|
+
cwd: packageRoot,
|
|
19
|
+
encoding: 'utf8',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
expect(result.status).toBe(0);
|
|
23
|
+
expect(result.stderr).toBe('');
|
|
24
|
+
expect(result.stdout.trim().split('\n')).toHaveLength(1);
|
|
25
|
+
|
|
26
|
+
const output = JSON.parse(result.stdout) as Record<string, unknown>;
|
|
27
|
+
const fixture = JSON.parse(readFileSync(fixturePath, 'utf8')) as unknown;
|
|
28
|
+
const model = buildProfileModel(fixture);
|
|
29
|
+
expect(model.ok).toBe(true);
|
|
30
|
+
if (!model.ok) throw new Error(model.error.code);
|
|
31
|
+
expect(output).toEqual({
|
|
32
|
+
query: 'summary',
|
|
33
|
+
...model.value.summary,
|
|
34
|
+
phases: model.value.phases,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "2.0",
|
|
3
|
+
"captureId": "capture-0001",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 2,
|
|
6
|
+
"eventLimit": 8,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [],
|
|
12
|
+
"completeness": {
|
|
13
|
+
"status": "partial",
|
|
14
|
+
"retainedEventCount": 0,
|
|
15
|
+
"droppedEventCount": 0,
|
|
16
|
+
"incompleteReason": "unsupported-version"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"captureId": "capture-0043",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 4,
|
|
6
|
+
"eventLimit": 8,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "phase",
|
|
14
|
+
"source": "app",
|
|
15
|
+
"frameId": 1,
|
|
16
|
+
"phase": "input",
|
|
17
|
+
"startMicros": 1000,
|
|
18
|
+
"endMicros": 1015,
|
|
19
|
+
"durationMicros": 15
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"completeness": {
|
|
23
|
+
"status": "partial",
|
|
24
|
+
"retainedEventCount": 1,
|
|
25
|
+
"droppedEventCount": 0,
|
|
26
|
+
"incompleteReason": "stopped-during-frame"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"captureId": "capture-0042",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 2,
|
|
6
|
+
"eventLimit": 8,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "phase",
|
|
14
|
+
"source": "app",
|
|
15
|
+
"frameId": 1,
|
|
16
|
+
"phase": "input",
|
|
17
|
+
"startMicros": 1000,
|
|
18
|
+
"endMicros": 1010,
|
|
19
|
+
"durationMicros": 10
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"kind": "phase",
|
|
23
|
+
"source": "app",
|
|
24
|
+
"frameId": 2,
|
|
25
|
+
"phase": "update",
|
|
26
|
+
"startMicros": 2000,
|
|
27
|
+
"endMicros": 2030,
|
|
28
|
+
"durationMicros": 30
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "skip",
|
|
32
|
+
"source": "render",
|
|
33
|
+
"frameId": 2,
|
|
34
|
+
"phase": "submit",
|
|
35
|
+
"reason": "no-render"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"completeness": {
|
|
39
|
+
"status": "complete",
|
|
40
|
+
"retainedEventCount": 3,
|
|
41
|
+
"droppedEventCount": 0
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cases": [
|
|
3
|
+
{
|
|
4
|
+
"name": "unsupported schema version",
|
|
5
|
+
"capture": { "schemaVersion": "2.0" }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "zero frame limit",
|
|
9
|
+
"capture": {
|
|
10
|
+
"schemaVersion": "1.0",
|
|
11
|
+
"captureId": "capture-0003",
|
|
12
|
+
"timeUnit": "microseconds",
|
|
13
|
+
"frameLimit": 0,
|
|
14
|
+
"eventLimit": 1,
|
|
15
|
+
"phaseCatalog": { "app": [], "render": [] },
|
|
16
|
+
"records": [],
|
|
17
|
+
"completeness": {
|
|
18
|
+
"status": "partial",
|
|
19
|
+
"retainedEventCount": 0,
|
|
20
|
+
"droppedEventCount": 0,
|
|
21
|
+
"incompleteReason": "stopped-before-frame"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "fractional event limit",
|
|
27
|
+
"capture": {
|
|
28
|
+
"schemaVersion": "1.0",
|
|
29
|
+
"captureId": "capture-0004",
|
|
30
|
+
"timeUnit": "microseconds",
|
|
31
|
+
"frameLimit": 1,
|
|
32
|
+
"eventLimit": 1.5,
|
|
33
|
+
"phaseCatalog": { "app": [], "render": [] },
|
|
34
|
+
"records": [],
|
|
35
|
+
"completeness": {
|
|
36
|
+
"status": "partial",
|
|
37
|
+
"retainedEventCount": 0,
|
|
38
|
+
"droppedEventCount": 0,
|
|
39
|
+
"incompleteReason": "stopped-before-frame"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "negative duration",
|
|
45
|
+
"capture": {
|
|
46
|
+
"schemaVersion": "1.0",
|
|
47
|
+
"captureId": "capture-0005",
|
|
48
|
+
"timeUnit": "microseconds",
|
|
49
|
+
"frameLimit": 1,
|
|
50
|
+
"eventLimit": 1,
|
|
51
|
+
"phaseCatalog": { "app": ["input"], "render": [] },
|
|
52
|
+
"records": [
|
|
53
|
+
{
|
|
54
|
+
"kind": "phase",
|
|
55
|
+
"source": "app",
|
|
56
|
+
"frameId": 1,
|
|
57
|
+
"phase": "input",
|
|
58
|
+
"startMicros": 20,
|
|
59
|
+
"endMicros": 10,
|
|
60
|
+
"durationMicros": -10
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"completeness": { "status": "complete", "retainedEventCount": 1, "droppedEventCount": 0 }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "unknown phase",
|
|
68
|
+
"capture": {
|
|
69
|
+
"schemaVersion": "1.0",
|
|
70
|
+
"captureId": "capture-0006",
|
|
71
|
+
"timeUnit": "microseconds",
|
|
72
|
+
"frameLimit": 1,
|
|
73
|
+
"eventLimit": 1,
|
|
74
|
+
"phaseCatalog": { "app": ["input"], "render": [] },
|
|
75
|
+
"records": [
|
|
76
|
+
{
|
|
77
|
+
"kind": "skip",
|
|
78
|
+
"source": "app",
|
|
79
|
+
"frameId": 1,
|
|
80
|
+
"phase": "unknown",
|
|
81
|
+
"reason": "not-declared"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"completeness": {
|
|
85
|
+
"status": "partial",
|
|
86
|
+
"retainedEventCount": 1,
|
|
87
|
+
"droppedEventCount": 0,
|
|
88
|
+
"incompleteReason": "phase-not-declared"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "complete with incomplete reason",
|
|
94
|
+
"capture": {
|
|
95
|
+
"schemaVersion": "1.0",
|
|
96
|
+
"captureId": "capture-0007",
|
|
97
|
+
"timeUnit": "microseconds",
|
|
98
|
+
"frameLimit": 1,
|
|
99
|
+
"eventLimit": 1,
|
|
100
|
+
"phaseCatalog": { "app": [], "render": [] },
|
|
101
|
+
"records": [],
|
|
102
|
+
"completeness": {
|
|
103
|
+
"status": "complete",
|
|
104
|
+
"retainedEventCount": 0,
|
|
105
|
+
"droppedEventCount": 0,
|
|
106
|
+
"incompleteReason": "source-failed"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "frame id is not positive safe integer",
|
|
112
|
+
"capture": {
|
|
113
|
+
"schemaVersion": "1.0",
|
|
114
|
+
"captureId": "capture-0008",
|
|
115
|
+
"timeUnit": "microseconds",
|
|
116
|
+
"frameLimit": 1,
|
|
117
|
+
"eventLimit": 1,
|
|
118
|
+
"phaseCatalog": { "app": ["input"], "render": [] },
|
|
119
|
+
"records": [
|
|
120
|
+
{ "kind": "skip", "source": "app", "frameId": -1, "phase": "input", "reason": "not-run" }
|
|
121
|
+
],
|
|
122
|
+
"completeness": {
|
|
123
|
+
"status": "partial",
|
|
124
|
+
"retainedEventCount": 1,
|
|
125
|
+
"droppedEventCount": 0,
|
|
126
|
+
"incompleteReason": "source-failed"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "overflow without affected frame range",
|
|
132
|
+
"capture": {
|
|
133
|
+
"schemaVersion": "1.0",
|
|
134
|
+
"captureId": "capture-0009",
|
|
135
|
+
"timeUnit": "microseconds",
|
|
136
|
+
"frameLimit": 1,
|
|
137
|
+
"eventLimit": 1,
|
|
138
|
+
"phaseCatalog": { "app": [], "render": [] },
|
|
139
|
+
"records": [],
|
|
140
|
+
"completeness": { "status": "overflow", "retainedEventCount": 0, "droppedEventCount": 1 }
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"captureId": "capture-0010",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 2,
|
|
6
|
+
"eventLimit": 8,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "phase",
|
|
14
|
+
"source": "app",
|
|
15
|
+
"frameId": 1,
|
|
16
|
+
"phase": "input",
|
|
17
|
+
"startMicros": 1000,
|
|
18
|
+
"endMicros": 1030,
|
|
19
|
+
"durationMicros": 30
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"kind": "phase",
|
|
23
|
+
"source": "app",
|
|
24
|
+
"frameId": 1,
|
|
25
|
+
"phase": "update",
|
|
26
|
+
"startMicros": 1100,
|
|
27
|
+
"endMicros": 1120,
|
|
28
|
+
"durationMicros": 20
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "phase",
|
|
32
|
+
"source": "app",
|
|
33
|
+
"frameId": 2,
|
|
34
|
+
"phase": "input",
|
|
35
|
+
"startMicros": 2000,
|
|
36
|
+
"endMicros": 2010,
|
|
37
|
+
"durationMicros": 10
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "skip",
|
|
41
|
+
"source": "render",
|
|
42
|
+
"frameId": 2,
|
|
43
|
+
"phase": "submit",
|
|
44
|
+
"reason": "no-render"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"completeness": {
|
|
48
|
+
"status": "overflow",
|
|
49
|
+
"retainedEventCount": 4,
|
|
50
|
+
"droppedEventCount": 2,
|
|
51
|
+
"firstAffectedFrameId": 2,
|
|
52
|
+
"lastAffectedFrameId": 2
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"captureId": "capture-0004",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 2,
|
|
6
|
+
"eventLimit": 4,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "phase",
|
|
14
|
+
"source": "app",
|
|
15
|
+
"frameId": 1,
|
|
16
|
+
"phase": "input",
|
|
17
|
+
"startMicros": 1000,
|
|
18
|
+
"endMicros": 1100,
|
|
19
|
+
"durationMicros": 100
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"completeness": {
|
|
23
|
+
"status": "partial",
|
|
24
|
+
"retainedEventCount": 1,
|
|
25
|
+
"droppedEventCount": 0,
|
|
26
|
+
"incompleteReason": "profile-sink-failed",
|
|
27
|
+
"firstAffectedFrameId": 1,
|
|
28
|
+
"lastAffectedFrameId": 1
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"captureId": "capture-0001",
|
|
4
|
+
"timeUnit": "microseconds",
|
|
5
|
+
"frameLimit": 2,
|
|
6
|
+
"eventLimit": 8,
|
|
7
|
+
"phaseCatalog": {
|
|
8
|
+
"app": ["input", "update"],
|
|
9
|
+
"render": ["prepare", "submit"]
|
|
10
|
+
},
|
|
11
|
+
"records": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "phase",
|
|
14
|
+
"source": "app",
|
|
15
|
+
"frameId": 1,
|
|
16
|
+
"phase": "input",
|
|
17
|
+
"startMicros": 1000,
|
|
18
|
+
"endMicros": 1100,
|
|
19
|
+
"durationMicros": 100
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"kind": "skip",
|
|
23
|
+
"source": "render",
|
|
24
|
+
"frameId": 1,
|
|
25
|
+
"phase": "submit",
|
|
26
|
+
"reason": "no-render"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "phase",
|
|
30
|
+
"source": "app",
|
|
31
|
+
"frameId": 2,
|
|
32
|
+
"phase": "update",
|
|
33
|
+
"startMicros": 2000,
|
|
34
|
+
"endMicros": 2200,
|
|
35
|
+
"durationMicros": 200
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"completeness": {
|
|
39
|
+
"status": "complete",
|
|
40
|
+
"retainedEventCount": 3,
|
|
41
|
+
"droppedEventCount": 0
|
|
42
|
+
}
|
|
43
|
+
}
|