Skip to content

Conversation

itssharmasandeep
Copy link
Contributor

@itssharmasandeep itssharmasandeep commented Apr 8, 2021

Description

feat: show exit calls break up on hover on exit calls cell in trace list

Testing

Local testing is done

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Working example for 0 exit calls
Screenshot 2021-04-07 at 12 44 50 PM

Working example for more than 0 exit calls
Screenshot 2021-04-07 at 12 46 32 PM

@itssharmasandeep itssharmasandeep requested a review from a team as a code owner April 8, 2021 10:48
@codecov
Copy link

codecov bot commented Apr 8, 2021

Codecov Report

Merging #756 (b0c8c46) into main (4776e67) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           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           
Impacted Files Coverage Δ
...apis/api-detail/traces/api-trace-list.dashboard.ts 100.00% <ø> (ø)
...vice-detail/traces/service-trace-list.dashboard.ts 100.00% <ø> (ø)
...ers/traces/traces-graphql-query-handler.service.ts 100.00% <100.00%> (ø)
...-calls/exit-calls-table-cell-renderer.component.ts 100.00% <100.00%> (ø)
.../table/observability-table-cell-renderer.module.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4776e67...b0c8c46. Read the comment docs.

@github-actions

This comment has been minimized.

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a 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?

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.


expect(spectator.component.getMaxShowAPICalleeNameCount(value)).toMatchObject(value);
expect(spectator.component.totalCountOfDifferentAPICallee).toBe(2);
expect(spectator.component.apiCalleeNameCount).toMatchObject([
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

<span class="exit-calls-count">{{ this.apiExitCalls }}</span>
<ng-template #exitCallsTooltip>
<ng-container *ngIf="this.apiExitCalls > 0">
Copy link
Contributor

@arjunlalb arjunlalb Apr 14, 2021

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>

Copy link
Contributor

@arjunlalb arjunlalb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aaron-steinfeld
Copy link
Contributor

lgtm other than existing comment on test

@itssharmasandeep itssharmasandeep merged commit 4325a3c into main Apr 14, 2021
@itssharmasandeep itssharmasandeep deleted the exit-calls branch April 14, 2021 15:13
@github-actions
Copy link

Unit Test Results

    4 files  ±0  248 suites  +1   16m 4s ⏱️ + 2m 2s
888 tests +1  888 ✔️ +1  0 💤 ±0  0 ❌ ±0 
894 runs  +1  894 ✔️ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 4325a3c. ± Comparison against base commit 4776e67.

@Inject(TABLE_ROW_DATA) rowData: Trace
) {
super(columnConfig, index, parser, cellData, rowData);
const apiCalleeNameCount: string[][] = Object.entries(cellData.value[1]);
Copy link
Contributor

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?

Copy link
Contributor

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).

Copy link
Contributor

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 {
Copy link
Contributor

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

Copy link
Contributor

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]}

Copy link
Contributor

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[];
}

Copy link
Contributor

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants