-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(perf): add timing instrumentation to measure runtime perf #3745
Changes from all commits
b8830cb
df7e1b4
f1a2909
c46548d
ab9386d
7c155b9
2a45eb5
046780b
4e77f81
c1dddac
6df7096
6b36595
135f960
2715db9
4807052
fc8817f
46e66ab
9125d05
b5cdd0c
680a985
f1045a7
17d90e0
1a0c8be
caf144a
6046bb4
01aeac7
852561b
3971b1f
8bf6cc1
88c888b
bcfaf7c
c72ac0c
274693a
bd03859
011f272
434f788
2ba317f
8c7b0a2
508506a
4a2e662
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,11 @@ async function loadArtifacts(basePath) { | |
artifacts.traces[passName] = Array.isArray(trace) ? {traceEvents: trace} : trace; | ||
}); | ||
|
||
if (Array.isArray(artifacts.Timing)) { | ||
// Any Timing entries in saved artifacts will have a different timeOrigin than the auditing phase | ||
// The `gather` prop is read later in generate-timing-trace and they're added to a separate track of trace events | ||
artifacts.Timing.forEach(entry => (entry.gather = true)); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this happen in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only want to break the trace into two tracks if they're done at different times. (Classic -G then -A workflow) So that's why we assign here to force a diff track. |
||
return artifacts; | ||
} | ||
|
||
|
@@ -74,6 +79,8 @@ async function loadArtifacts(basePath) { | |
* @return {Promise<void>} | ||
*/ | ||
async function saveArtifacts(artifacts, basePath) { | ||
const status = {msg: 'Saving artifacts', id: 'lh:assetSaver:saveArtifacts'}; | ||
log.time(status); | ||
mkdirp.sync(basePath); | ||
rimraf.sync(`${basePath}/*${traceSuffix}`); | ||
rimraf.sync(`${basePath}/${artifactsFilename}`); | ||
|
@@ -95,6 +102,7 @@ async function saveArtifacts(artifacts, basePath) { | |
const restArtifactsString = JSON.stringify(restArtifacts, null, 2); | ||
fs.writeFileSync(`${basePath}/${artifactsFilename}`, restArtifactsString, 'utf8'); | ||
log.log('Artifacts saved to disk in folder:', basePath); | ||
log.timeEnd(status); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this testing?