-
Notifications
You must be signed in to change notification settings - Fork 487
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 model/trace-dag to prep for latency diffs #521
Conversation
Codecov Report
@@ Coverage Diff @@
## master #521 +/- ##
==========================================
- Coverage 93.00% 92.78% -0.22%
==========================================
Files 197 197
Lines 4848 4839 -9
Branches 1177 1185 +8
==========================================
- Hits 4509 4490 -19
- Misses 299 309 +10
Partials 40 40
Continue to review full report at Codecov.
|
a141445
to
be6c215
Compare
Hey @tiffon, unfortunately I won't have bandwidth to pore over this PR for two weeks, sorry. If you intend on continuing to work on 513, you should probably branch off of this branch without waiting for review. |
@everett980 thanks for the heads up. |
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.
@tiffon Sorry for the delay in getting to this.
This diff looks good, thanks!
I left a few comments but all but one are about type names or copyright (BTW: didn't comment on each copyright addition) so it shouldn't take long to update.
@@ -1,3 +1,4 @@ | |||
// Copyright (c) 2020 The Jaeger Authors. |
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.
I believe we don't typically update the Copyright for existing files. @yurishkuro please confirm
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.
We don't have a firm policy. Some lawyers told me that the "correct" way to update copyrights is to add a year when the change is made, so one could end up with Copyright (c) 2017,2019,2020 The Jaeger Authors.
Which seems rather heavy handed and somewhat pointless since one needs to go through Git history to figure out which parts of the code are C in which year.
A simpler solution is to use a range 2017-2020
.
Simple replacing C with the current year appears to be wrong, but still done in many oss projects (and tooling).
So I would go with the range, if there was a year before.
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.
Done, changed to use range from previous date but now is set to Jaeger Authors.
@@ -1,3 +1,4 @@ | |||
// Copyright (c) 2020 The Jaeger Authors. |
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.
same question about adding / updating licenses
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.
Done
function getUiFindVertexKeysFn(uiFind: string, vertices: TDagVertex<any>[]): Set<TVertexKey> { | ||
function getUiFindVertexKeysFn( | ||
uiFind: string, | ||
vertices: DagPlexusVertex<DenseSpanMembers>[] |
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.
👍 replacing any
🎉
@@ -1,3 +1,4 @@ | |||
// Copyright (c) 2020 The Jaeger Authors. |
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.
same copyright question
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.
Done
@@ -1,3 +1,4 @@ | |||
// Copyright (c) 2020 The Jaeger Authors. |
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.
same copyright question
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.
Done
@@ -32,3 +29,14 @@ export type DenseSpan = { | |||
skipToChild: boolean; | |||
children: Set<string>; | |||
}; | |||
|
|||
export type DenseSpanMembers = { |
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.
why not TDenseSpanMembers
?
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.
Done.
service: string; | ||
}; | ||
|
||
export type DiffCounts = DenseSpanMembers & { |
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.
why not TDiffCounts
?
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.
Done.
service: string; | ||
}; | ||
|
||
export type DiffCounts = DenseSpanMembers & { |
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.
Instead of having members
, operation
, and service
on this and a
& b
, I think we can we get away with:
export type TDiffCounts = TDenseSpanMembers & {
a: DenseSpan[] | null;
b: DenseSpan[] | null;
};
seems a bit simpler and would avoid duplicate data.
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.
SGTM. Keen eye.
The thought behind a
and b
being TDagNode
s is they're the input to the diff, in their original form. Your change reduces the data down to what's relevant, so I think it makes sense and is better. I have some notion of it being a nice idea to add one-vs-many comparisons. In that case, I was thinking the schema would be a Map
with keys being trace IDs and values being the TDagNode
from the corresponding trace. This morphed into using "a" and "b" mapped to the TDagNode
. Which is not a very good rationale.
|
||
// eslint-disable-next-line no-undef | ||
export default TDagVertex; | ||
export default DagPlexusVertex; |
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.
this should also have a T
, TDagPlexusVertex
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.
Done.
}; | ||
|
||
// eslint-disable-next-line no-undef | ||
export default DagNode; |
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.
this should also have a T
, TDagNode
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.
Done
Also, I noticed the code coverage for the diff is below master's coverage. Do you plan on improving coverage when continuing with the feature work for #513 or should that be included in this diff? |
- Refactor TraceDag class to make it simpler and more flexible - Change DagNode to be a simple type instead of a class - Change the data on DagNode to extend DagNode instead of live off the "data" field - Base the data model for trace diffs on collections of DenseSpans instead of just the count of spans in a vs b for a given node in the comparison DAG - Lay some small (id-factories.tsx) ground-work for being more flexible in how the DAG is built from the trace, which is to say how spans are grouped Signed-off-by: Joe Farro <joe@jf.io>
be6c215
to
dc39cbe
Compare
@everett980 Damn, I sent an email to this conversation but it isn't here. Sorry for the major delay in responding. The changes are made. LMK if you see anything else. |
@everett980 Regarding the test coverage, I was thinking to bulk it up when I add latency comparisons. |
@tiffon no worries. In return, I managed to miss the GitHub emails for your comments.
SGTM |
- Refactor TraceDag class to make it simpler and more flexible - Change DagNode to be a simple type instead of a class - Change the data on DagNode to extend DagNode instead of live off the "data" field - Base the data model for trace diffs on collections of DenseSpans instead of just the count of spans in a vs b for a given node in the comparison DAG - Lay some small (id-factories.tsx) ground-work for being more flexible in how the DAG is built from the trace, which is to say how spans are grouped Signed-off-by: Joe Farro <joe@jf.io> Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
Which problem is this PR solving?
Short description of the changes
TraceDag
class to make it simpler and more flexibleDagNode
to be a simple type instead of a classDagNode
to extendDagNode
instead of live off thedata
fieldDenseSpan
s instead of just the count of spans for a given node in the comparison DAG (e.g. 7 vs 4 are now arrays instead of just the count)