-
Notifications
You must be signed in to change notification settings - Fork 11
feat: show exit calls break up on hover on exit calls cell in trace list #756
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #756 +/- ##
=======================================
Coverage 85.37% 85.38%
=======================================
Files 788 789 +1
Lines 16132 16143 +11
Branches 2060 2060
=======================================
+ Hits 13772 13783 +11
Misses 2329 2329
Partials 31 31
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
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.
Could we see a screenshot of this in action?
...c/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.scss
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
||
expect(spectator.component.getMaxShowAPICalleeNameCount(value)).toMatchObject(value); | ||
expect(spectator.component.totalCountOfDifferentAPICallee).toBe(2); | ||
expect(spectator.component.apiCalleeNameCount).toMatchObject([ |
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 test has value, but what would be even better would be to verify that this data renders - for example by querying for the rendered spans and checking their content (e.g. expect(spectator.queryAll('.api-callee-name')[0]).toContainText('key1');
)
That checks both how the data is processed but also that the template is correctly binding what we expect.
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.
Okay, this change I can make.
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.
Nevermind, discussed offline - because this is a template that's not rendered in the scope of this component, it's ugly to test and not worth it.
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
...src/shared/components/table/data-cell/exit-calls/exit-calls-table-cell-renderer.component.ts
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
<span class="exit-calls-count">{{ this.apiExitCalls }}</span> | ||
<ng-template #exitCallsTooltip> | ||
<ng-container *ngIf="this.apiExitCalls > 0"> |
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.
nit: This is an if-else use case. You can clean this up like below. There are many examples in the codebase.
<ng-container *ngIf="this.apiExitCalls > 0; else noExitCalls">
Content goes here
</ng-container>
<ng-template #noExitCalls></ng-template>
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.
LGTM
lgtm other than existing comment on test |
@Inject(TABLE_ROW_DATA) rowData: Trace | ||
) { | ||
super(columnConfig, index, parser, cellData, rowData); | ||
const apiCalleeNameCount: string[][] = Object.entries(cellData.value[1]); |
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 name is confusing to me mainly because of 'Count' suffix. So
apiCalleeNameCount
is a dictionary?
can we call it apiCalleeNameEntires
instead?
-
Is
[string, string][]
a better type? -
totalCountOfDifferentApiCallee -> uniqueApiCallee
-
Line 71. Why do we need to use
slice
here?
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.
Agree naming is confusing/type suggestions. Line 71 is meant to limit the amount of pairs to show in the tooltip, but again naming would help clarify (maxShowApiCalleeNameCount
as a const value could be MAX_API_CALLEE_TO_SHOW
, for example).
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.
Let's also rename maxShowApiCalleeNameCount
to MAX_API_CALLEE_TO_SHOW
import { Trace } from '@hypertrace/distributed-tracing'; | ||
import { ObservabilityTableCellType } from '../../observability-table-cell-type'; | ||
|
||
interface CellData { |
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.
{
type: 'composite-specification',
specifications: [
{
type: 'attribute-specification',
attribute: 'apiExitCalls'
},
{
type: 'attribute-specification',
attribute: 'apiCalleeNameCount'
}
],
'order-by': 'apiExitCalls'
},
}
Wouldn't the cell data be an array of [apiExitCalls, apiCalleeNameCount]
? Trying to understand how this object structure is coming with units and value info
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.
the query handlers append units on to everything so instead of that array, it's wrapped in an object with units like {units?: string; value: [apiExitCalls, apiCalleeNameCount]}
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.
Did this change recently?
I remember using composite spec where I have used value as array directly(let me find it). And regardless, imo the specification should reflect this object structure.
export interface CompositeSpecification extends Specification {
extractFromServerData(resultContainer: Dictionary<unknown>): unknown[];
}
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.
Possibly, table is calling parser's parseValue
is called after stripping units.
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 does seem a bit suspicious - the wrapping object should only be there if units are defined, which they shouldn't be for a composite spec.
Description
feat: show exit calls break up on hover on exit calls cell in trace list
Testing
Local testing is done
Checklist:
Working example for 0 exit calls

Working example for more than 0 exit calls
