Skip to content

Commit ff6b6a3

Browse files
committed
Parse additional aggregate coordinator info
1 parent c515cb9 commit ff6b6a3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

redisinsight/ui/src/packages/ri-explain/src/Explain.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ export default function Explain(props: IExplain): JSX.Element {
8282
let [cluster, entityInfo] = ParseProfileCluster(info)
8383
cluster['Coordinator'].forEach((kv: [string, string]) => profilingTime[kv[0]] = kv[1])
8484
data = entityInfo
85+
} else if (typeof info[0] === 'string' && info[0].toLowerCase().startsWith('coordinator')) {
86+
const resultsProfile = info[2]
87+
data = ParseProfile(resultsProfile)
88+
profilingTime = {
89+
'Total Coordinator time': info[4],
90+
'Total profile time': resultsProfile[0][1],
91+
'Parsing time': resultsProfile[1][1],
92+
'Pipeline creation time': resultsProfile[2][1],
93+
}
8594
} else {
8695
data = ParseProfile(info)
8796
profilingTime = {

redisinsight/ui/src/packages/ri-explain/src/parser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ export function ParseProfileCluster(info: any[]): [Object, EntityInfo] {
825825

826826
export function ParseProfile(info: any[][]): EntityInfo {
827827
const parserData: any = info[info.length - 2]
828-
let resp = ParseIteratorProfile(parserData[1])
828+
let resp = parserData[0].toLowerCase().startsWith('iterators') ? ParseIteratorProfile(parserData[1]) : null
829829

830830
const processorsProfile: string[][] = info[info.length - 1].slice(1)
831831

@@ -837,11 +837,11 @@ export function ParseProfile(info: any[][]): EntityInfo {
837837
type: e[1] as EntityType,
838838
time: e[3],
839839
counter: e[5],
840-
children: [{...resp, parentId: id}],
840+
children: resp ? [{...resp, parentId: id}] : [],
841841
}
842842
}
843843

844-
return resp
844+
return resp as EntityInfo
845845
}
846846

847847
export function ParseIteratorProfile(data: any[]): EntityInfo {

0 commit comments

Comments
 (0)