-
Notifications
You must be signed in to change notification settings - Fork 983
Fix invalid timings in span events #4486
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
Changes from 3 commits
0efb5da
03e84e3
0e90f68
18fa4c0
f7880ce
4e87873
6dfef84
24c7f6c
c773b8f
b9bf4ea
441a301
4f98c14
a3ccf1e
6ac28d4
cec2c3b
98c1496
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 |
|---|---|---|
|
|
@@ -60,13 +60,21 @@ export function hasKey<O extends object>( | |
| export function addSpanNetworkEvent( | ||
| span: api.Span, | ||
| performanceName: string, | ||
| entries: PerformanceEntries | ||
| entries: PerformanceEntries, | ||
| refPerfName?: string | ||
Abinet18 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ): api.Span | undefined { | ||
| if ( | ||
| hasKey(entries, performanceName) && | ||
| typeof entries[performanceName] === 'number' | ||
| ) { | ||
| span.addEvent(performanceName, entries[performanceName]); | ||
| let perfTime = entries[performanceName]; | ||
| const refName = refPerfName || PTN.FETCH_START; | ||
| // Use a reference time whcih is the earliest possible value so that the performance timing are earlier can be corrected to this reference time | ||
|
||
| // using FETCH START time in case no reference is provided | ||
| if (hasKey(entries, refName) && typeof entries[refName] === 'number') { | ||
| perfTime = Math.max(perfTime || 0, entries[refName] || 0); | ||
| } | ||
| span.addEvent(performanceName, perfTime); | ||
| return span; | ||
| } | ||
| return undefined; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.