-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into deprecate-v2-license
- Loading branch information
Showing
5 changed files
with
112 additions
and
39 deletions.
There are no files selected for viewing
5 changes: 2 additions & 3 deletions
5
...ls/MQTables/getTopicThroughputOverview.ts → ...agingQueues/getTopicThroughputOverview.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTableUtils.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { RowData } from 'pages/MessagingQueues/MessagingQueuesUtils'; | ||
|
||
import { MessagingQueuesPayloadProps } from './getConsumerLagDetails'; | ||
|
||
export function getTableDataForProducerLatencyOverview( | ||
data: MessagingQueuesPayloadProps['payload'], | ||
): RowData[] { | ||
if (data?.result?.length === 0) { | ||
return []; | ||
} | ||
|
||
const firstTableData = data.result[0].table.rows || []; | ||
const secondTableData = data.result[1]?.table.rows || []; | ||
|
||
// Create a map for quick lookup of byte_rate using service_name and topic | ||
const byteRateMap = new Map( | ||
secondTableData.map((row) => [ | ||
`${row.data.service_name}--${row.data.topic}`, | ||
row.data.byte_rate, | ||
]), | ||
); | ||
|
||
// Merge the data from both tables | ||
const mergedTableData: RowData[] = | ||
firstTableData.map( | ||
(row, index): RowData => ({ | ||
...row.data, | ||
byte_rate: | ||
byteRateMap.get(`${row.data.service_name}--${row.data.topic}`) || 0, | ||
key: index, | ||
}), | ||
) || []; | ||
|
||
return mergedTableData; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters