Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const apiTraceListDashboard = {
{
type: 'table-widget-column',
title: 'Exit Calls',
filterable: true,
filterable: false,
display: ObservabilityTableCellType.ExitCalls,
value: {
type: 'composite-specification',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const serviceTraceListDashboard = {
{
type: 'table-widget-column',
title: 'Exit Calls',
filterable: true,
filterable: false,
display: ObservabilityTableCellType.ExitCalls,
value: {
type: 'composite-specification',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@include body-1-regular($gray-7);
}

.api-callee-name-count {
.api-callee-name-entries {
@include body-small($gray-3);
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ describe('Exit Calls table cell renderer component', () => {
});

expect(spectator.queryAll('.exit-calls-count')[0]).toContainText('3');
expect(spectator.component.apiCalleeNameCount).toMatchObject([
expect(spectator.component.apiCalleeNameEntires).toMatchObject([
['key1', '1'],
['key2', '2']
]);
expect(spectator.component.totalCountOfDifferentApiCallee).toBe(2);
expect(spectator.component.uniqueApiCallee).toBe(2);
expect(spectator.component.apiExitCalls).toBe(3);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,16 @@ interface CellData {
<span class="exit-calls-count">{{ this.apiExitCalls }}</span>

<ng-template #exitCallsTooltip>
<ng-container *ngIf="this.apiExitCalls > 0">
<div *ngFor="let item of this.apiCalleeNameCount" class="api-callee-name-count">
<ng-container *ngIf="this.apiExitCalls > 0; else noExitCalls">
<div *ngFor="let item of this.apiCalleeNameEntires" class="api-callee-name-entries">
<span class="api-callee-name">{{ item[0] }}</span>
<span class="api-callee-count">{{ item[1] }}</span>
</div>
<div
*ngIf="this.totalCountOfDifferentApiCallee > this.maxShowApiCalleeNameCount"
class="remaining-api-callee"
>
and {{ this.totalCountOfDifferentApiCallee - this.maxShowApiCalleeNameCount }} more
<div *ngIf="this.uniqueApiCallee > this.MAX_API_CALLEE_TO_SHOW" class="remaining-api-callee">
and {{ this.uniqueApiCallee - this.MAX_API_CALLEE_TO_SHOW }} more
</div>
</ng-container>
<ng-container *ngIf="this.apiExitCalls <= 0" class="no-exit-calls">No exit calls</ng-container>
<ng-template #noExitCalls>No exit calls</ng-template>
</ng-template>
</div>
`
Expand All @@ -52,10 +49,10 @@ interface CellData {
parser: CoreTableCellParserType.NoOp
})
export class ExitCallsTableCellRendererComponent extends TableCellRendererBase<CellData, Trace> implements OnInit {
public readonly apiCalleeNameCount: string[][];
public readonly apiCalleeNameEntires: [string, string][];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public readonly apiCalleeNameEntires: [string, string][];
public readonly apiCalleeNameEntries: [string, string][];

(and references)

public readonly apiExitCalls: number;
public readonly maxShowApiCalleeNameCount: number = 10;
public readonly totalCountOfDifferentApiCallee!: number;
public readonly MAX_API_CALLEE_TO_SHOW: number = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

With a const like this, we should make it static (and lift it above the instance vars)

Copy link
Contributor

Choose a reason for hiding this comment

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

also, please rename to MAX_API_CALLEES_TO_SHOW

public readonly uniqueApiCallee: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend uniqueApiCalleeCount


public constructor(
@Inject(TABLE_COLUMN_CONFIG) columnConfig: TableColumnConfig,
Expand All @@ -66,9 +63,9 @@ export class ExitCallsTableCellRendererComponent extends TableCellRendererBase<C
@Inject(TABLE_ROW_DATA) rowData: Trace
) {
super(columnConfig, index, parser, cellData, rowData);
const apiCalleeNameCount: string[][] = Object.entries(cellData.value[1]);
this.totalCountOfDifferentApiCallee = apiCalleeNameCount.length;
this.apiCalleeNameCount = apiCalleeNameCount.slice(0, this.maxShowApiCalleeNameCount);
const apiCalleeNameEntires: [string, string][] = Object.entries(cellData.value[1]);
this.uniqueApiCallee = apiCalleeNameEntires.length;
this.apiCalleeNameEntires = apiCalleeNameEntires.slice(0, this.MAX_API_CALLEE_TO_SHOW);
this.apiExitCalls = cellData.value[0];
}
}