diff --git a/ide/src/trace/bean/BoxSelection.ts b/ide/src/trace/bean/BoxSelection.ts index 1d5076f55debff7b0bb40436488ea2ea22590c93..7933b5c06bf1e33e16ddd343c68fba2b16277c9e 100644 --- a/ide/src/trace/bean/BoxSelection.ts +++ b/ide/src/trace/bean/BoxSelection.ts @@ -345,7 +345,7 @@ export class SelectionParam { for (let i = 0; i < it.asyncFuncThreadName.length; i++) { const tn = it.asyncFuncThreadName[i]; this.funCatAsync.push({ - pid: it.asyncFuncNamePID || 0, + pid: it.asyncFuncNamePID || 0,//@ts-ignore threadName: tn }); } diff --git a/ide/src/trace/component/chart/SpProcessChart.ts b/ide/src/trace/component/chart/SpProcessChart.ts index 0cda58a01bb20eda5155f745fa2e3eb586404222..74ff08516025516caaad5a715e23fc41f89e20f1 100644 --- a/ide/src/trace/component/chart/SpProcessChart.ts +++ b/ide/src/trace/component/chart/SpProcessChart.ts @@ -60,7 +60,7 @@ export class SpProcessChart { private readonly trace: SpSystemTrace; private processAsyncFuncMap: unknown = {}; private processAsyncFuncArray: unknown[] = []; - private processAsyncFuncCatMap: any = {}; + private processAsyncFuncCatMap: unknown = {}; private eventCountMap: unknown; private processThreads: Array = []; private processMem: Array = []; @@ -141,7 +141,7 @@ export class SpProcessChart { this.processAsyncFuncArray = asyncFuncList; this.processAsyncFuncMap = Utils.groupBy(asyncFuncList, 'pid'); - let asyncFuncCatList: any[] = await queryProcessAsyncFuncCat(); + let asyncFuncCatList: unknown[] = await queryProcessAsyncFuncCat(); info('AsyncFuncCatData Count is: ', asyncFuncCatList!.length); this.processAsyncFuncCatMap = Utils.groupBy(asyncFuncCatList, 'pid'); }; @@ -1461,33 +1461,33 @@ export class SpProcessChart { processRow.addChildTraceRow(funcRow); } - addAsyncCatFunction(it: { pid: number; processName: string | null }, processRow: TraceRow): void { + addAsyncCatFunction(it: { pid: number; processName: string | null }, processRow: TraceRow): void { //@ts-ignore let asyncFuncCatList = this.processAsyncFuncCatMap[it.pid] || []; - let asyncFuncGroup: any = Utils.groupBy(asyncFuncCatList, 'threadName'); - Reflect.ownKeys(asyncFuncGroup).map((key: any) => { - let asyncFunctions: Array = asyncFuncGroup[key]; + let asyncFuncGroup: unknown = Utils.groupBy(asyncFuncCatList, 'threadName'); //@ts-ignore + Reflect.ownKeys(asyncFuncGroup).map((key: unknown) => { //@ts-ignore + let asyncFunctions: Array = asyncFuncGroup[key]; if (asyncFunctions.length > 0) { - let isIntersect = (a: any, b: any): boolean => + let isIntersect = (a: unknown, b: unknown): boolean => //@ts-ignore Math.max(a.startTs + a.dur, b.startTs + b.dur) - Math.min(a.startTs, b.startTs) < a.dur + b.dur; - let depthArray: any = []; - asyncFunctions.forEach((it, i) => { - if (it.dur === -1 || it.dur === null || it.dur === undefined) { - it.dur = (TraceRow.range?.endNS || 0) - it.startTs; - it.flag = 'Did not end'; + let depthArray: unknown = []; + asyncFunctions.forEach((it, i) => { //@ts-ignore + if (it.dur === -1 || it.dur === null || it.dur === undefined) { //@ts-ignore + it.dur = (TraceRow.range?.endNS || 0) - it.startTs; //@ts-ignore + it.flag = 'Did not end'; //@ts-ignore it.nofinish = true; } let currentDepth = 0; - let index = i; + let index = i; //@ts-ignore while (depthArray[currentDepth] !== undefined && isIntersect(depthArray[currentDepth], asyncFunctions[index])) { currentDepth++; - } - asyncFunctions[index].depth = currentDepth; - depthArray[currentDepth] = asyncFunctions[index]; + } //@ts-ignore + asyncFunctions[index].depth = currentDepth; //@ts-ignore + depthArray[currentDepth] = asyncFunctions[index]; //@ts-ignore this.toAsyncFuncCache(asyncFunctions[index], `${asyncFunctions[0].threadName}`); }); const maxHeight = this.calMaxHeight(asyncFunctions); - let funcRow = TraceRow.skeleton(); - funcRow.rowId = `${asyncFunctions[0].threadName}`; + let funcRow = TraceRow.skeleton(); //@ts-ignore + funcRow.rowId = `${asyncFunctions[0].threadName}`; //@ts-ignore funcRow.asyncFuncThreadName = asyncFunctions[0].threadName; funcRow.asyncFuncNamePID = it.pid; funcRow.rowType = TraceRow.ROW_TYPE_FUNC; @@ -1496,16 +1496,16 @@ export class SpProcessChart { funcRow.rowHidden = !processRow.expansion; funcRow.style.width = '100%'; funcRow.style.height = `${maxHeight}px`; - funcRow.setAttribute('height', `${maxHeight}`); + funcRow.setAttribute('height', `${maxHeight}`); //@ts-ignore funcRow.name = `${asyncFunctions[0].threadName}`; funcRow.setAttribute('children', ''); funcRow.findHoverStruct = (): void => { FuncStruct.hoverFuncStruct = funcRow.getHoverStruct(); - } - funcRow.supplier = (): Promise => new Promise((resolve) => resolve(asyncFunctions)); + }; //@ts-ignore + funcRow.supplier = (): Promise => new Promise((resolve) => resolve(asyncFunctions)); funcRow.favoriteChangeHandler = this.trace.favoriteChangeHandler; funcRow.selectChangeHandler = this.trace.selectChangeHandler; - funcRow.onThreadHandler = rowThreadHandler('func', 'context', { + funcRow.onThreadHandler = rowThreadHandler('func', 'context', { //@ts-ignore type: `func-${asyncFunctions[0].threadName}-${it.pid}`, }, funcRow, this.trace); processRow.addChildTraceRow(funcRow); diff --git a/ide/src/trace/component/trace/base/TraceRow.ts b/ide/src/trace/component/trace/base/TraceRow.ts index 7d7335520fef46b17074c96afb2d514620515900..31ef27a80414659c74410afc781c9a44699cd7a1 100644 --- a/ide/src/trace/component/trace/base/TraceRow.ts +++ b/ide/src/trace/component/trace/base/TraceRow.ts @@ -189,7 +189,7 @@ export class TraceRow extends HTMLElement { static isUserInteraction: boolean; asyncFuncName: string | Array | undefined | null; asyncFuncNamePID: number | undefined | null; - asyncFuncThreadName: Array| string | undefined | null; + asyncFuncThreadName: Array | string | undefined | null; translateY: number = 0; //single canvas offsetY; // @ts-ignore childrenList: Array> = []; // @ts-ignore diff --git a/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts b/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts index f884af39e62ceb1eb644db8d70bf1530b660826d..ee2a510e31ada561d24ad3ac53a1d34a2e0203a4 100644 --- a/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts +++ b/ide/src/trace/component/trace/sheet/process/TabPaneSlices.ts @@ -52,8 +52,8 @@ export class TabPaneSlices extends BaseElement { }); let asyncCatNames: Array = []; let asyncCatPid: Array = [];//@ts-ignore - slicesParam.funCatAsync.forEach((it: any) => { - asyncCatNames.push(it.threadName); + slicesParam.funCatAsync.forEach((it: unknown) => {//@ts-ignore + asyncCatNames.push(it.threadName);//@ts-ignore asyncCatPid.push(it.pid); }); this.slicesTbl!.loading = true; diff --git a/ide/src/trace/database/sql/Func.sql.ts b/ide/src/trace/database/sql/Func.sql.ts index d0688f762a51ee6539cff9de7fdf9275d86ba6b8..7ae0b4a6a5c567412bd9c5effda0a02fecf5a2f0 100644 --- a/ide/src/trace/database/sql/Func.sql.ts +++ b/ide/src/trace/database/sql/Func.sql.ts @@ -150,7 +150,7 @@ export const queryProcessAsyncFunc = ( { traceId: traceId } ); -export const queryProcessAsyncFuncCat = (): Promise> => +export const queryProcessAsyncFuncCat = (): Promise> => query( 'queryProcessAsyncFuncCat', `