-
Notifications
You must be signed in to change notification settings - Fork 483
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
[Refactor]: Enhancement to selfTime calculation logic in TraceStatistics view #1901
[Refactor]: Enhancement to selfTime calculation logic in TraceStatistics view #1901
Conversation
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
|
Is this calculations are correct Or am I doing wrong ? |
Regarding the tests, I would recommend replacing the times / durations in the fixture files with smaller numbers that are easier to grok without a calculator, like start=100000, duration=100 (pick values to retain the overall magnitude, but make the numbers round) |
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.test.js
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
...TracePage/TraceStatistics/tableValuesTestTrace/traceWithSingleChildSpanLongerThanParent.json
Show resolved
Hide resolved
...nents/TracePage/TraceStatistics/tableValuesTestTrace/traceWithTwoNonOverlappingChildren.json
Show resolved
Hide resolved
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
…bleValues.tsx Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: GLVSKiriti <116095646+GLVSKiriti@users.noreply.github.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/TracePage/TraceStatistics/tableValues.tsx
Outdated
Show resolved
Hide resolved
@@ -315,18 +147,18 @@ function valueFirstDropdown(selectedTagKey: string, trace: Trace) { | |||
for (let j = 0; j < allSpans.length; j++) { |
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.
Just to illustrate my earlier point about linear searches: with this loop in place we're doing O(N^2) work.
Signed-off-by: GLVS Kiriti <glvskiriti2003369@gmail.com>
Signed-off-by: GLVSKiriti <116095646+GLVSKiriti@users.noreply.github.com>
tempSelfChange += span.duration - duration; | ||
|
||
return tempSelfChange; | ||
return Math.round(spanRange.length / 10); |
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.
btw, I don't think rounding is necessary, length should always be divisible by 10.
Thanks! |
Hi, @GLVSKiriti and @yurishkuro . Sorry, I don't quite understand why we need this *10 logic in We have the comment in the function:
But in my understanding if we have |
@maxgaponov you may be right |
Which problem is this PR solving?
Description of the changes
FOLLOWS_FROM
type child spansDRange
similar to the logic in TraceGraph@yurishkuro