From 3dccacc1aeb2f4826dea718ce7c7d309f3d25d77 Mon Sep 17 00:00:00 2001 From: jichuan Date: Mon, 3 Jul 2023 09:56:56 +0800 Subject: [PATCH 01/10] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D6=E6=9C=8821?= =?UTF-8?q?=E6=97=A5=E5=89=8D=E5=8F=91=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jichuan --- ide/src/base-ui/checkbox/LitCheckBox.ts | 19 +- ide/src/base-ui/select/LitSelect.ts | 12 +- ide/src/base-ui/select/LitSelectOption.ts | 3 +- ide/src/base-ui/switch/lit-switch.ts | 22 +- ide/src/command/Cmd.ts | 64 +++ ide/src/command/CmdConstant.ts | 2 + ide/src/doc/compile_trace_streamer.html | 10 +- ide/src/trace/SpApplication.ts | 35 +- ide/src/trace/bean/BoxSelection.ts | 1 - ide/src/trace/bean/WakeupBean.ts | 1 - ide/src/trace/component/SpMetrics.ts | 19 +- ide/src/trace/component/SpQuerySQL.ts | 10 +- ide/src/trace/component/SpRecordTrace.ts | 20 +- ide/src/trace/component/SpSystemTrace.ts | 407 ++++++------------ .../trace/component/chart/SpChartManager.ts | 2 - .../trace/component/chart/SpJsMemoryChart.ts | 6 +- .../component/chart/SpNativeMemoryChart.ts | 1 + .../trace/component/chart/SpProcessChart.ts | 4 +- .../trace/component/metrics/CpuStrategy.ts | 43 +- .../metrics/DistributeTermStrategy.ts | 19 +- .../trace/component/metrics/MemAggStrategy.ts | 15 +- .../trace/component/metrics/MemStrategy.ts | 8 +- .../component/metrics/MetaDataStrategy.ts | 5 +- .../component/metrics/SysCallsStrategy.ts | 8 +- .../component/metrics/SysCallsTopStrategy.ts | 18 +- .../component/metrics/TraceStatsStrategy.ts | 10 +- .../component/metrics/TraceTaskStrategy.ts | 7 +- .../trace/component/setting/SpAllocations.ts | 56 +-- .../trace/component/setting/SpCheckDesBox.ts | 6 +- .../trace/component/setting/SpFileSystem.ts | 72 +--- .../trace/component/setting/SpHisysEvent.ts | 6 +- ide/src/trace/component/setting/SpJsHeap.ts | 51 +-- .../trace/component/setting/SpProbesConfig.ts | 19 +- .../trace/component/setting/SpRecordPerf.ts | 72 +--- .../component/setting/SpRecordTemplate.ts | 14 +- .../trace/component/setting/SpSdkConfig.ts | 17 +- .../trace/component/setting/SpTraceCommand.ts | 4 +- .../trace/component/setting/SpVmTracker.ts | 55 +-- .../setting/utils/PluginConvertUtils.ts | 6 +- .../component/trace/TimerShaftElement.ts | 102 ++--- .../trace/component/trace/base/ColorUtils.ts | 14 +- .../trace/component/trace/base/RangeSelect.ts | 4 + .../trace/component/trace/base/TraceRow.ts | 43 +- .../component/trace/base/TraceRowConfig.ts | 50 ++- .../trace/component/trace/base/TraceSheet.ts | 19 +- .../component/trace/base/TraceSheetConfig.ts | 6 - .../component/trace/sheet/TabPaneCurrent.ts | 119 ----- .../trace/sheet/TabPaneCurrentSelection.ts | 82 +--- .../trace/sheet/cpu/TabPaneCounterSample.ts | 4 +- .../trace/sheet/cpu/TabPaneFrequencySample.ts | 8 +- .../TabPaneFilesystemStatisticsAnalysis.ts | 210 +++++---- .../TabPaneIOTierStatisticsAnalysis.ts | 210 +++++---- .../TabPaneVirtualMemoryStatisticsAnalysis.ts | 208 +++++---- .../trace/sheet/hiperf/TabPanePerfAnalysis.ts | 139 +++--- .../TabPaneNMStatisticAnalysis.ts | 233 +++++----- .../trace/sheet/process/TabPaneSlices.ts | 2 +- .../trace/sheet/process/TabPaneThreadUsage.ts | 66 +-- .../component/trace/timer-shaft/RangeRuler.ts | 20 +- .../component/trace/timer-shaft/SportRuler.ts | 237 ++-------- ide/src/trace/database/DBUtils.ts | 95 ++++ ide/src/trace/database/SqlLite.ts | 55 ++- ide/src/trace/database/TempSql.ts | 5 +- ide/src/trace/database/TraceWorker.ts | 116 +++-- .../ProcedureLogicWorkerCommon.ts | 11 +- .../ProcedureLogicWorkerNativeNemory.ts | 3 +- .../ProcedureLogicWorkerSchedulingAnalysis.ts | 4 +- .../database/ui-worker/ProcedureWorkerCPU.ts | 22 - .../ui-worker/ProcedureWorkerCommon.ts | 131 ++---- .../database/ui-worker/ProcedureWorkerMem.ts | 5 + trace_streamer/gn/.emscripten | 2 +- trace_streamer/gn/toolchain/BUILD.gn | 6 +- trace_streamer/pare_third_party.sh | 12 +- .../prebuilts/patch_hiperf/BUILD.gn | 2 +- trace_streamer/sdk/demo_sdk/doc/wasm.md | 10 +- trace_streamer/sdk/dubai_sdk/doc/wasm.md | 10 +- 75 files changed, 1449 insertions(+), 1965 deletions(-) delete mode 100644 ide/src/trace/component/trace/sheet/TabPaneCurrent.ts create mode 100644 ide/src/trace/database/DBUtils.ts diff --git a/ide/src/base-ui/checkbox/LitCheckBox.ts b/ide/src/base-ui/checkbox/LitCheckBox.ts index dcb5693a..cacb1cdf 100644 --- a/ide/src/base-ui/checkbox/LitCheckBox.ts +++ b/ide/src/base-ui/checkbox/LitCheckBox.ts @@ -143,15 +143,14 @@ export class LitCheckBox extends BaseElement { } connectedCallback() { - this.checkbox!.addEventListener('change', (ev) => { + this.checkbox!.addEventListener('change', () => { this.checked = this.checkbox!.checked; - this.dispatchEvent( - new CustomEvent('change', { - detail: { - checked: this.checked, - }, - }) - ); + let changeEvent: CustomEventInit = { + detail: { + checked: this.checked, + }, + }; + this.dispatchEvent(new CustomEvent('change', changeEvent)); }); } @@ -165,3 +164,7 @@ export class LitCheckBox extends BaseElement { } } } + +export interface LitCheckBoxChangeEvent { + checked: boolean; +} diff --git a/ide/src/base-ui/select/LitSelect.ts b/ide/src/base-ui/select/LitSelect.ts index 985f1d01..28d1dded 100644 --- a/ide/src/base-ui/select/LitSelect.ts +++ b/ide/src/base-ui/select/LitSelect.ts @@ -22,6 +22,7 @@ export class LitSelect extends BaseElement { private selectInputEl: any; private selectClearEl: any; private selectIconEl: any; + private bodyEl: any; private selectSearchEl: any; private selectMultipleRootEl: any; @@ -278,6 +279,7 @@ export class LitSelect extends BaseElement { connectedCallback() { this.tabIndex = 0; this.focused = false; + this.bodyEl = this.shadowRoot!.querySelector('.body'); this.selectInputEl = this.shadowRoot!.querySelector('input'); this.selectClearEl = this.shadowRoot!.querySelector('.clear'); this.selectIconEl = this.shadowRoot!.querySelector('.icon'); @@ -313,19 +315,20 @@ export class LitSelect extends BaseElement { if (this.focused === false) { this.selectInputEl.focus(); this.focused = true; + this.bodyEl!.style.display = 'block'; } else { this.blur(); + this.bodyEl!.style.display = 'none'; this.focused = false; } } }; this.onmouseover = this.onfocus = (ev) => { if (this.focused === false && this.hasAttribute('adaptive-expansion')) { - let body = this.shadowRoot!.querySelector('.body'); - if (this.parentElement!.offsetTop < body!.clientHeight) { - body!.classList.add('body-bottom'); + if (this.parentElement!.offsetTop < this.bodyEl!.clientHeight) { + this.bodyEl!.classList.add('body-bottom'); } else { - body!.classList.remove('body-bottom'); + this.bodyEl!.classList.remove('body-bottom'); } } if (this.hasAttribute('allow-clear')) { @@ -487,6 +490,7 @@ export class LitSelect extends BaseElement { } else { [...this.querySelectorAll('lit-select-option')].forEach((a) => a.removeAttribute('selected')); this.blur(); + this.bodyEl!.style.display = 'none'; // @ts-ignore this.selectInputEl.value = e.detail.text; } diff --git a/ide/src/base-ui/select/LitSelectOption.ts b/ide/src/base-ui/select/LitSelectOption.ts index 59daef7e..cbade4cd 100644 --- a/ide/src/base-ui/select/LitSelectOption.ts +++ b/ide/src/base-ui/select/LitSelectOption.ts @@ -31,7 +31,8 @@ export class LitSelectOption extends BaseElement { color: var(--dark-color2,#333); tab-index: -1; align-items: center; - width: 100%; + width: max-content; + min-width: 100%; max-lines: 1; white-space: nowrap; font-size: 0.8rem; diff --git a/ide/src/base-ui/switch/lit-switch.ts b/ide/src/base-ui/switch/lit-switch.ts index 2355109c..98f214e2 100644 --- a/ide/src/base-ui/switch/lit-switch.ts +++ b/ide/src/base-ui/switch/lit-switch.ts @@ -132,17 +132,23 @@ export default class LitSwitch extends BaseElement { this.checked = this.checked; this.switch!.onchange = (ev) => { this.checked = this.switch!.checked; - this.dispatchEvent(new CustomEvent('change', { detail: { checked: this.checked } })); + let changeEvent: CustomEventInit = { + detail: { + checked: this.checked, + }, + }; + this.dispatchEvent(new CustomEvent('change', changeEvent)); }; this.switch.onkeydown = (ev) => { switch (ev.keyCode) { case 13: //enter this.checked = !this.checked; - this.dispatchEvent( - new CustomEvent('change', { - detail: { checked: this.checked }, - }) - ); + let changeEvent: CustomEventInit = { + detail: { + checked: this.checked, + }, + }; + this.dispatchEvent(new CustomEvent('change', changeEvent)); break; default: break; @@ -190,3 +196,7 @@ export default class LitSwitch extends BaseElement { } } } + +export interface LitSwitchChangeEvent { + checked: boolean; +} diff --git a/ide/src/command/Cmd.ts b/ide/src/command/Cmd.ts index b15711fe..1b7dacac 100644 --- a/ide/src/command/Cmd.ts +++ b/ide/src/command/Cmd.ts @@ -13,6 +13,10 @@ * limitations under the License. */ +import { SpRecordTrace } from '../trace/component/SpRecordTrace.js'; +import { CmdConstant } from './CmdConstant.js'; +import { HdcDeviceManager } from '../hdc/HdcDeviceManager.js'; + export class Cmd { static CmdSendPostUtils(uri: string, callback: Function, requestData: any) { // @ts-ignore @@ -173,4 +177,64 @@ export class Cmd { let result = res.ok ? await res.text() : ''; return result; } + + static convertOutProcessList(res: string): string[] { + let processData: string[] = []; + if (res) { + let lineValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/); + for (let lineVal of lineValues) { + lineVal = lineVal.trim(); + if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('CMD') != -1 || lineVal.length === 0) { + continue; + } else { + let process: string[] = lineVal.split(' '); + if (process.length == 2) { + processData.push(process[1] + '(' + process[0] + ')'); + } + } + } + } + return processData; + } + static getDebugProcess(): Promise { + return new Promise((resolve, reject) => { + if (SpRecordTrace.isVscode) { + let cmd = Cmd.formatString(CmdConstant.CMD_GET_DEBUG_PROCESS_DEVICES, [SpRecordTrace.serialNumber]); + Cmd.execHdcCmd(cmd, (res: string) => { + resolve(Cmd.convertOutProcessList(res)); + }); + } else { + HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => { + if (conn) { + HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_DEBUG_PROCESS, false).then((res) => { + resolve(Cmd.convertOutProcessList(res)); + }); + } else { + reject(-1); + } + }); + } + }); + } + + static getProcess(): Promise { + return new Promise((resolve, reject) => { + if (SpRecordTrace.isVscode) { + let cmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]); + Cmd.execHdcCmd(cmd, (res: string) => { + resolve(Cmd.convertOutProcessList(res)); + }); + } else { + HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => { + if (conn) { + HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((res) => { + resolve(Cmd.convertOutProcessList(res)); + }); + } else { + reject(-1); + } + }); + } + }); + } } diff --git a/ide/src/command/CmdConstant.ts b/ide/src/command/CmdConstant.ts index 3662a1d6..428875a4 100644 --- a/ide/src/command/CmdConstant.ts +++ b/ide/src/command/CmdConstant.ts @@ -22,6 +22,7 @@ export class CmdConstant { static CMD_GET_CPU_COUNT = "hdc_std shell grep -c 'processor' /proc/cpuinfo"; static CMD_GET_HIPERF_EVENTS = 'hdc_std shell hiperf list'; static CMD_GET_VERSION = 'hdc_std shell param get const.product.software.version'; + static CMD_GET_DEBUG_PROCESS = `hdc_std shell netstat -anp |grep Panda |grep -v grep | sed \'s/.* \\([0-9]*\\)\\/.*/\\1/\' |xargs -r ps -A -opid,cmd`; static CMD_HDC_DEVICES = 'hdc_std list targets'; static CMD_MOUNT_DEVICES = 'hdc_std -t {0} shell mount -o remount,rw /'; static CMD_GET_PROCESS_DEVICES = 'hdc_std -t {0} shell ps -A -opid,cmd'; @@ -33,4 +34,5 @@ export class CmdConstant { 'hdc_std -t {0} shell killall hiprofilerd hiprofiler_plugins native_daemon hiperf hiebpf' + ' hiprofiler_cmd'; static CMS_STOP = 'hdc_std shell killall hiprofilerd hiprofiler_plugins native_daemon hiperf hiebpf hiprofiler_cmd'; static CMD_GET_VERSION_DEVICES = 'hdc_std -t {0} shell param get const.product.software.version'; + static CMD_GET_DEBUG_PROCESS_DEVICES = `hdc_std -t {0} shell netstat -anp |grep Panda |grep -v grep | sed \'s/.* \\([0-9]*\\)\\/.*/\\1/\' |xargs -r ps -A -opid,cmd`; } diff --git a/ide/src/doc/compile_trace_streamer.html b/ide/src/doc/compile_trace_streamer.html index c4f815ed..64eb5f5a 100644 --- a/ide/src/doc/compile_trace_streamer.html +++ b/ide/src/doc/compile_trace_streamer.html @@ -809,11 +809,11 @@ git pull │ └── prebuilts/emsdk/emsdk/lib │ └── prebuilts/emsdk/emsdk/lib/clang └── prebuilts/emsdk/node - └── prebuilts/emsdk/node/16.20.0_64bit - ├── prebuilts/emsdk/node/16.20.0_64bit/bin - ├── prebuilts/emsdk/node/16.20.0_64bit/include - ├── prebuilts/emsdk/node/16.20.0_64bit/lib - └── prebuilts/emsdk/node/16.20.0_64bit/share + └── prebuilts/emsdk/node/14.18.2_64bit + ├── prebuilts/emsdk/node/14.18.2_64bit/bin + ├── prebuilts/emsdk/node/14.18.2_64bit/include + ├── prebuilts/emsdk/node/14.18.2_64bit/lib + └── prebuilts/emsdk/node/14.18.2_64bit/share

之后调用

                     
                     
+                    
                 
                 
                 
@@ -411,6 +413,7 @@ export class SpApplication extends BaseElement {
     let menu = mainMenu.shadowRoot?.querySelector('.menu-button') as HTMLDivElement;
     let progressEL = this.shadowRoot?.querySelector('.progress') as LitProgressBar;
     let litSearch = this.shadowRoot?.querySelector('#lit-search') as LitSearch;
+    let litRecordSearch = this.shadowRoot?.querySelector('#lit-record-search') as LitSearch;
     let search = this.shadowRoot?.querySelector('.search-container') as HTMLElement;
     let sidebarButton: HTMLDivElement | undefined | null = this.shadowRoot?.querySelector('.sidebar-button');
     let childNodes = [
@@ -575,8 +578,8 @@ export class SpApplication extends BaseElement {
         menu!.style.pointerEvents = 'auto';
         sidebarButton!.style.pointerEvents = 'auto';
         that.search = true;
-        litSearch.setPercent('', 101);
-        litSearch.clear();
+        litRecordSearch.style.display = 'none';
+        litSearch.style.display = 'block';
         window.publish(window.SmartEvent.UI.KeyboardEnable, {
           enable: true,
         });
@@ -585,6 +588,8 @@ export class SpApplication extends BaseElement {
         menu!.style.pointerEvents = 'none';
         sidebarButton!.style.pointerEvents = 'none';
         that.search = litSearch.isLoading;
+        litSearch.style.display = 'none';
+        litRecordSearch.style.display = 'block';
         window.publish(window.SmartEvent.UI.KeyboardEnable, {
           enable: false,
         });
@@ -823,7 +828,7 @@ export class SpApplication extends BaseElement {
     function handleWasmMode(ev: any, showFileName: string, fileSize: string, fileName: string) {
       litSearch.setPercent('', 1);
       threadPool.init('wasm').then((res) => {
-        let reader = new FileReader();
+        let reader: FileReader | null = new FileReader();
         reader.readAsArrayBuffer(ev as any);
         reader.onloadend = function (ev) {
           info('read file onloadend');
@@ -878,6 +883,7 @@ export class SpApplication extends BaseElement {
                 mainMenu.menus = mainMenu.menus!;
               }
               spInfoAndStats.initInfoAndStatsData();
+              reader = null;
             }
           );
         };
@@ -1251,7 +1257,7 @@ export class SpApplication extends BaseElement {
     );
   }
 
-  private download(mainMenu: LitMainMenu, fileName: string, isServer: boolean, dbName?: string) {
+  private async download(mainMenu: LitMainMenu, fileName: string, isServer: boolean, dbName?: string) {
     let a = document.createElement('a');
     if (isServer) {
       if (dbName != '') {
@@ -1261,7 +1267,8 @@ export class SpApplication extends BaseElement {
         return;
       }
     } else {
-      a.href = URL.createObjectURL(new Blob([DbPool.sharedBuffer!]));
+      let buffer = await getTraceFileBuffer(DbPool.currentTraceFileID);
+      a.href = URL.createObjectURL(new Blob([buffer!]));
     }
     a.download = fileName;
     a.click();
@@ -1327,14 +1334,16 @@ export class SpApplication extends BaseElement {
             });
           }
         } else {
-          const fd = new FormData();
-          fd.append('convertType', 'download');
-          fd.append('filePath', filePath);
-          fd.append('file', new File([DbPool.sharedBuffer!], fileName));
-          Cmd.uploadFile(fd, (res: Response) => {
-            if (res.ok) {
-              this.itemIconLoading(mainMenu, 'Current Trace', 'Download File', false);
-            }
+          getTraceFileBuffer(DbPool.currentTraceFileID).then(buffer => {
+            const fd = new FormData();
+            fd.append('convertType', 'download');
+            fd.append('filePath', filePath);
+            fd.append('file', new File([buffer!], fileName));
+            Cmd.uploadFile(fd, (res: Response) => {
+              if (res.ok) {
+                this.itemIconLoading(mainMenu, 'Current Trace', 'Download File', false);
+              }
+            });
           });
         }
       }
diff --git a/ide/src/trace/bean/BoxSelection.ts b/ide/src/trace/bean/BoxSelection.ts
index 080ba368..a3d73099 100644
--- a/ide/src/trace/bean/BoxSelection.ts
+++ b/ide/src/trace/bean/BoxSelection.ts
@@ -31,7 +31,6 @@ export class SelectionParam {
   diskIOLatency: boolean = false;
   fsCount: number = 0;
   vmCount: number = 0;
-  isCurrentPane: boolean = false;
 
   cpus: Array = [];
   cpuStateFilterIds: Array = [];
diff --git a/ide/src/trace/bean/WakeupBean.ts b/ide/src/trace/bean/WakeupBean.ts
index 616af8cb..6353d513 100644
--- a/ide/src/trace/bean/WakeupBean.ts
+++ b/ide/src/trace/bean/WakeupBean.ts
@@ -23,5 +23,4 @@ export class WakeupBean {
   schedulingLatency: number | undefined;
   schedulingDesc: string | undefined;
   ts: number | undefined;
-  itid: number | undefined;
 }
diff --git a/ide/src/trace/component/SpMetrics.ts b/ide/src/trace/component/SpMetrics.ts
index b6aeaa1a..d8b0d0b7 100644
--- a/ide/src/trace/component/SpMetrics.ts
+++ b/ide/src/trace/component/SpMetrics.ts
@@ -16,12 +16,7 @@
 import { BaseElement, element } from '../../base-ui/BaseElement.js';
 
 import {
-  queryDistributedTerm,
-  querySelectTraceStats,
-  querySystemCalls,
-  querySystemCallsTop,
-  queryTraceCpu,
-  queryTraceCpuTop,
+  querySelectTraceStats, querySystemCalls,
   queryTraceMemory,
   queryTraceMemoryTop,
   queryTraceMemoryUnAgg,
@@ -30,12 +25,8 @@ import {
 } from '../database/SqlLite.js';
 
 import '../../base-ui/table/lit-table.js';
-import { initCpuStrategyData, initTest } from './metrics/CpuStrategy.js';
-import { initDistributedTermData } from './metrics/DistributeTermStrategy.js';
 import { initMemoryAggStrategy } from './metrics/MemAggStrategy.js';
 import { initMemoryStrategy } from './metrics/MemStrategy.js';
-import { initSysCallsStrategy } from './metrics/SysCallsStrategy.js';
-import { initSysCallsTopStrategy } from './metrics/SysCallsTopStrategy.js';
 import { initTraceStateStrategy } from './metrics/TraceStatsStrategy.js';
 import { initTraceTaskStrategy } from './metrics/TraceTaskStrategy.js';
 import { initMetaDataStrategy } from './metrics/MetaDataStrategy.js';
@@ -43,6 +34,7 @@ import { PluginConvertUtils } from './setting/utils/PluginConvertUtils.js';
 import { info } from '../../log/Log.js';
 import { LitProgressBar } from '../../base-ui/progress-bar/LitProgressBar.js';
 import { SpStatisticsHttpUtil } from '../../statistics/util/SpStatisticsHttpUtil.js';
+import { initSysCallsStrategy } from './metrics/SysCallsStrategy.js';
 
 @element('sp-metrics')
 export class SpMetrics extends BaseElement {
@@ -121,7 +113,7 @@ export class SpMetrics extends BaseElement {
     }
   }
 
-  runClickListener = (event: any) => {
+  runClickListener = () => {
     SpStatisticsHttpUtil.addOrdinaryVisitAction({
       event: 'metrics',
       action: 'metrics',
@@ -340,8 +332,3 @@ export interface MetricQueryItem {
   metricQuery: Function;
   metricResultHandle: Function;
 }
-
-export class SpMetricsItem {
-  itemTip: string | undefined;
-  itemValue: any[] | undefined;
-}
diff --git a/ide/src/trace/component/SpQuerySQL.ts b/ide/src/trace/component/SpQuerySQL.ts
index 0b61a99a..d1656294 100644
--- a/ide/src/trace/component/SpQuerySQL.ts
+++ b/ide/src/trace/component/SpQuerySQL.ts
@@ -93,7 +93,7 @@ export class SpQuerySQL extends BaseElement {
       copyResult += keyListKey + '\t';
     }
     copyResult += '\n';
-    let copyData: any = [];
+    let copyData = [];
     if (this.statDataArray.length > this.maxPageSize) {
       copyData = this.sliceData;
     } else {
@@ -105,10 +105,10 @@ export class SpQuerySQL extends BaseElement {
       });
       copyResult += '\n';
     }
-    await (navigator as any).clipboard.writeText(copyResult);
+    await navigator.clipboard.writeText(copyResult);
   }
 
-  selectEventListener = (event: any) => {
+  selectEventListener = (event: KeyboardEvent) => {
     let that = this;
     if (event.ctrlKey && event.keyCode == 13) {
       SpStatisticsHttpUtil.addOrdinaryVisitAction({
@@ -324,7 +324,7 @@ export class SpQuerySQL extends BaseElement {
     this.selector!.addEventListener('keydown', this.deleteSqlListener);
   }
 
-  deleteSqlListener = (event: any) => {
+  deleteSqlListener = (event: KeyboardEvent) => {
     if (event.key == 'Backspace') {
       this.resizeSqlHeight().then(() => {});
     }
@@ -346,7 +346,7 @@ export class SpQuerySQL extends BaseElement {
     this.selector?.style.height = selectHeight;
   }
 
-  inputSqlListener = async (event: any) => {
+  inputSqlListener = async (event: Event) => {
     this.resizeSqlHeight().then(() => {});
     let startData = new Date().getTime();
     if (this.selector!.value.trim() == '') {
diff --git a/ide/src/trace/component/SpRecordTrace.ts b/ide/src/trace/component/SpRecordTrace.ts
index 0f4701cb..55517dc2 100644
--- a/ide/src/trace/component/SpRecordTrace.ts
+++ b/ide/src/trace/component/SpRecordTrace.ts
@@ -523,7 +523,7 @@ export class SpRecordTrace extends BaseElement {
     }
   }
 
-  private refreshDeviceTimer: any;
+  private refreshDeviceTimer: number | undefined;
 
   initElements(): void {
     let parentElement = this.parentNode as HTMLElement;
@@ -651,7 +651,7 @@ export class SpRecordTrace extends BaseElement {
     this.recordButtonText = this.shadowRoot?.querySelector('.record_text') as HTMLSpanElement;
     this.sp = document.querySelector('sp-application') as SpApplication;
     this.progressEL = this.sp.shadowRoot?.querySelector('.progress') as LitProgressBar;
-    this.litSearch = this.sp.shadowRoot?.querySelector('#lit-search') as LitSearch;
+    this.litSearch = this.sp.shadowRoot?.querySelector('#lit-record-search') as LitSearch;
     if (this.deviceSelect!.options && this.deviceSelect!.options.length > 0) {
       this.disconnectButton!.hidden = false;
       this.recordButton!.hidden = false;
@@ -666,16 +666,16 @@ export class SpRecordTrace extends BaseElement {
         this.stopRecordListener();
       }
     });
-    this.spRecordPerf!.addEventListener('addProbe', (event: any) => {
+    this.spRecordPerf!.addEventListener('addProbe', () => {
       this.showHint = false;
     });
-    this.spAllocations!.addEventListener('addProbe', (event: any) => {
+    this.spAllocations!.addEventListener('addProbe', () => {
       this.showHint = false;
     });
-    this.probesConfig!.addEventListener('addProbe', (event: any) => {
+    this.probesConfig!.addEventListener('addProbe', () => {
       this.showHint = false;
     });
-    this.spRecordTemplate!.addEventListener('addProbe', (event: any) => {
+    this.spRecordTemplate!.addEventListener('addProbe', () => {
       this.showHint = false;
     });
     this.menuGroup = this.shadowRoot?.querySelector('#menu-group') as LitMainMenuGroup;
@@ -1868,14 +1868,14 @@ export class SpRecordTrace extends BaseElement {
     return htraceProfilerPluginConfig;
   }
 
-  static appendSerialize(profilerPluginConfig: ProfilerPluginConfig) {
+  static appendSerialize(profilerPluginConfig: ProfilerPluginConfig<{}>) {
     if (Number(SpRecordTrace.selectVersion) >= 4.0) {
     }
   }
 
   private createSdkConfig() {
     let gpuConfig = this.spSdkConfig!.getGpuConfig();
-    let gpuPluginConfig: ProfilerPluginConfig = {
+    let gpuPluginConfig: ProfilerPluginConfig<{}> = {
       pluginName: this.spSdkConfig!.getPlugName(),
       sampleInterval: this.spSdkConfig!.getSampleInterval(),
       configData: gpuConfig,
@@ -1897,8 +1897,8 @@ export class SpRecordTrace extends BaseElement {
   }
 
   public startRefreshDeviceList() {
-    if (this.refreshDeviceTimer == null) {
-      this.refreshDeviceTimer = setInterval(() => {
+    if (this.refreshDeviceTimer === undefined) {
+      this.refreshDeviceTimer = window.setInterval(() => {
         this.refreshDeviceList();
       }, 5000);
     }
diff --git a/ide/src/trace/component/SpSystemTrace.ts b/ide/src/trace/component/SpSystemTrace.ts
index 16d1e12e..1ed9c556 100644
--- a/ide/src/trace/component/SpSystemTrace.ts
+++ b/ide/src/trace/component/SpSystemTrace.ts
@@ -26,7 +26,7 @@ import { SelectionParam } from '../bean/BoxSelection.js';
 import { procedurePool } from '../database/Procedure.js';
 import { SpApplication } from '../SpApplication.js';
 import { Flag } from './trace/timer-shaft/Flag.js';
-import { SportRuler, SlicesTime } from './trace/timer-shaft/SportRuler.js';
+import { SportRuler } from './trace/timer-shaft/SportRuler.js';
 import { SpHiPerf } from './chart/SpHiPerf.js';
 import { SearchSdkBean, SearchThreadProcessBean } from '../bean/SearchFuncBean.js';
 import { error, info } from '../../log/Log.js';
@@ -35,7 +35,6 @@ import {
   drawLines,
   drawLinkLines,
   drawWakeUp,
-  drawWakeUpList,
   isFrameContainPoint,
   ns2x,
   ns2xByTimeShaft,
@@ -43,7 +42,7 @@ import {
   Rect,
 } from '../database/ui-worker/ProcedureWorkerCommon.js';
 import { SpChartManager } from './chart/SpChartManager.js';
-import { CpuStruct, WakeupBean } from '../database/ui-worker/ProcedureWorkerCPU.js';
+import { CpuStruct } from '../database/ui-worker/ProcedureWorkerCPU.js';
 import { ProcessStruct } from '../database/ui-worker/ProcedureWorkerProcess.js';
 import { CpuFreqStruct } from '../database/ui-worker/ProcedureWorkerFreq.js';
 import { CpuFreqLimitsStruct } from '../database/ui-worker/ProcedureWorkerCpuFreqLimits.js';
@@ -65,9 +64,6 @@ import { Utils } from './trace/base/Utils.js';
 import { IrqStruct } from '../database/ui-worker/ProcedureWorkerIrq.js';
 import { JanksStruct } from '../bean/JanksStruct.js';
 import { JankStruct } from '../database/ui-worker/ProcedureWorkerJank.js';
-import { tabConfig } from './trace/base/TraceSheetConfig.js';
-import { TabPaneCurrent } from './trace/sheet/TabPaneCurrent.js';
-import { LitTabpane } from '../../base-ui/tabs/lit-tabpane.js';
 import { HeapStruct } from '../database/ui-worker/ProcedureWorkerHeap.js';
 import { SpStatisticsHttpUtil } from '../../statistics/util/SpStatisticsHttpUtil.js';
 import { HeapSnapshotStruct } from '../database/ui-worker/ProcedureWorkerHeapSnapshot.js';
@@ -76,27 +72,11 @@ import { TabPaneSummary } from './trace/sheet/snapshot/TabPaneSummary.js';
 import { LitTabs } from '../../base-ui/tabs/lit-tabs.js';
 import { SpJsMemoryChart } from './chart/SpJsMemoryChart.js';
 import { TraceRowConfig } from './trace/base/TraceRowConfig.js';
-import { TabPaneCurrentSelection } from './trace/sheet/TabPaneCurrentSelection.js';
+import { HeapTimelineStruct } from '../database/ui-worker/ProcedureWorkerHeapTimeline.js';
 
 function dpr() {
   return window.devicePixelRatio || 1;
 }
-//节流处理
-function throttle(fn: any, t: number, ev: any): any {
-  let timer: any = null;
-  return function () {
-    if (!timer) {
-      timer = setTimeout(function () {
-        if (ev) {
-          fn(ev);
-        } else {
-          fn();
-        }
-        timer = null;
-      }, t);
-    }
-  }
-}
 
 @element('sp-system-trace')
 export class SpSystemTrace extends BaseElement {
@@ -108,7 +88,6 @@ export class SpSystemTrace extends BaseElement {
   static DATA_DICT: Map = new Map();
   static SDK_CONFIG_MAP: any;
   static sliceRangeMark: any;
-  static wakeupList: Array = [];
   intersectionObserver: IntersectionObserver | undefined;
   tipEL: HTMLDivElement | undefined | null;
   rowsEL: HTMLDivElement | undefined | null;
@@ -127,11 +106,9 @@ export class SpSystemTrace extends BaseElement {
       this.observerScrollHeightCallback();
     }
   });
-  static btnTimer: any = null;
   isMousePointInSheet = false;
   hoverFlag: Flag | undefined | null = undefined;
-  selectFlag: Flag | undefined | null;
-  slicestime: SlicesTime | undefined | null = null;
+  selectFlag: Flag | undefined | null = undefined;
   public timerShaftEL: TimerShaftElement | null | undefined;
   private traceSheetEL: TraceSheet | undefined | null;
   private rangeSelect!: RangeSelect;
@@ -144,7 +121,6 @@ export class SpSystemTrace extends BaseElement {
   canvasPanelCtx: CanvasRenderingContext2D | undefined | null;
   linkNodes: PairPoint[][] = [];
   public currentClickRow: HTMLDivElement | undefined | null;
-  private litTabs: LitTabs | undefined | null;
   eventMap: any = {};
   private isSelectClick: boolean = false;
   private selectionParam: SelectionParam | undefined;
@@ -170,11 +146,6 @@ export class SpSystemTrace extends BaseElement {
   }
 
   initElements(): void {
-    let sideColor = document!.querySelector("body > sp-application")!.shadowRoot!.querySelector!("#main-menu")?.
-      shadowRoot?.querySelector("div.bottom > div.color");
-    let rightButton: HTMLElement | null | undefined =
-      this.shadowRoot?.querySelector("div > trace-sheet")?.shadowRoot?.
-        querySelector("#current-selection > tabpane-current-selection")?.shadowRoot?.querySelector("#rightButton")
     this.rowsEL = this.shadowRoot?.querySelector('.rows');
     this.tipEL = this.shadowRoot?.querySelector('.tip');
     this.rowsPaneEL = this.shadowRoot?.querySelector('.rows-pane');
@@ -184,23 +155,6 @@ export class SpSystemTrace extends BaseElement {
     this.traceSheetEL = this.shadowRoot?.querySelector('.trace-sheet');
     this.favoriteRowsEL = this.shadowRoot?.querySelector('.favorite-rows');
     this.rangeSelect = new RangeSelect(this);
-    rightButton?.addEventListener('click', (event: any) => {
-      if (SpSystemTrace.btnTimer) {
-        return;
-      }
-      this.wakeupListNull();
-      SpSystemTrace.wakeupList.unshift(CpuStruct.wakeupBean!);
-      this.queryCPUWakeUpList(CpuStruct.wakeupBean!);
-      setTimeout(() => {
-        requestAnimationFrame(() => this.refreshCanvas(false));
-      }, 300);
-      SpSystemTrace.btnTimer = setTimeout(() => {
-        SpSystemTrace.btnTimer = null; // 2.清空节流阀,方便下次开启定时器
-      }, 2000);
-    });
-    sideColor?.addEventListener('click', (event: any) => {
-      requestAnimationFrame(() => this.refreshCanvas(true));
-    });
     document?.addEventListener('triangle-flag', (event: any) => {
       let temporaryTime = this.timerShaftEL?.drawTriangle(event.detail.time, event.detail.type);
       if (event.detail.timeCallback && temporaryTime) event.detail.timeCallback(temporaryTime);
@@ -213,14 +167,6 @@ export class SpSystemTrace extends BaseElement {
         this.refreshCanvas(true);
       }
     });
-    document?.addEventListener('slices-change', (event: any) => {
-      this.timerShaftEL?.modifySlicesList(event.detail);
-      if (event.detail.hidden) {
-        this.slicestime = null;
-        this.traceSheetEL?.setAttribute('mode', 'hidden');
-        this.refreshCanvas(true);
-      }
-    });
     if (this.timerShaftEL?.collecBtn) {
       this.timerShaftEL.collecBtn.onclick = () => {
         if (this.timerShaftEL!.collecBtn!.hasAttribute('close')) {
@@ -256,19 +202,6 @@ export class SpSystemTrace extends BaseElement {
         replaceRow.setAttribute('row-parent-id', currentRow.rowParentId);
         replaceRow.style.display = 'none';
         currentRow.rowHidden = !currentRow.hasAttribute('scene');
-        // 添加收藏时,在线程名前面追加父亲ID
-        let rowParentId = currentRow.rowParentId
-        if (rowParentId) {
-          let parentRows = this.shadowRoot?.querySelectorAll>(
-            `trace-row[row-id='${rowParentId}']`
-          );
-          parentRows?.forEach((parentRow) => {
-            if (parentRow?.name && parentRow?.name != currentRow.name && !parentRow.rowType!.startsWith('cpu')
-              && !parentRow.rowType!.startsWith('thread') && !parentRow.rowType!.startsWith('func')) {
-              currentRow.name += "(" + parentRow.name + ")"
-            }
-          })
-        }
         if (this.rowsEL!.contains(currentRow)) {
           this.rowsEL!.replaceChild(replaceRow, currentRow);
         } else {
@@ -287,26 +220,22 @@ export class SpSystemTrace extends BaseElement {
           }
         }
         let row = currentRow;
+        let allowExpansionRow = [];
         while (row.hasParentRowEl) {
           let parent = row.parentRowEl;
-          if (!parent.expansion && parent.hasAttribute('scene')) {
-            parent.expansion = true;
-          }
+          allowExpansionRow.push(parent);
           row = parent;
         }
+        for (let index: number = allowExpansionRow.length - 1; index >= 0; index--) {
+          if (!allowExpansionRow[index]?.expansion && allowExpansionRow[index]?.hasAttribute('scene')) {
+            allowExpansionRow[index].expansion = true;
+          }
+        }
+        allowExpansionRow.length = 0;
         let replaceRow = this.rowsEL!.querySelector(
           `div[row-id='${currentRow.rowId}-${currentRow.rowType}']`
         );
         if (replaceRow != null) {
-          // 取消收藏时,删除父亲ID 
-          let rowNameArr = currentRow.name.split("(");
-          if (rowNameArr.length > 1) {
-            let tempName = "";
-            tempName += rowNameArr[0];
-            currentRow.name = tempName;
-          } else {
-            currentRow.name = rowNameArr[0];
-          }
           this.rowsEL!.replaceChild(currentRow, replaceRow);
           currentRow.style.boxShadow = `0 10px 10px #00000000`;
         }
@@ -445,6 +374,7 @@ export class SpSystemTrace extends BaseElement {
         } else if (it.rowType == TraceRow.ROW_TYPE_CPU_FREQ_LIMIT) {
           selection.cpuFreqLimitDatas.push(it.dataList!);
         } else if (it.rowType == TraceRow.ROW_TYPE_PROCESS) {
+          this.pushPidToSelection(selection, it.rowId!);
           let processChildRows: Array> = [
             ...this.shadowRoot!.querySelectorAll>(`trace-row[row-parent-id='${it.rowId}']`),
           ];
@@ -489,14 +419,11 @@ export class SpSystemTrace extends BaseElement {
           });
           info('load nativeMemory traceRow id is : ', it.rowId);
         } else if (it.rowType == TraceRow.ROW_TYPE_THREAD) {
-          let pid = parseInt(it.rowParentId!);
-          // @ts-ignore
-          if (!selection.processIds.includes(pid)) {
-            selection.processIds.push(pid);
-          }
+          this.pushPidToSelection(selection, it.rowParentId!);
           selection.threadIds.push(parseInt(it.rowId!));
           info('load thread traceRow id is : ', it.rowId);
         } else if (it.rowType == TraceRow.ROW_TYPE_FUNC) {
+          this.pushPidToSelection(selection, it.rowParentId!);
           if (it.asyncFuncName) {
             selection.funAsync.push({
               name: it.asyncFuncName,
@@ -665,13 +592,30 @@ export class SpSystemTrace extends BaseElement {
             return isIntersect(jankData, TraceRow.rangeSelectObject!);
           });
           selection.jankFramesData.push(jankDatas);
-        } else if (it.rowType == TraceRow.ROW_TYPE_HEAP_TIMELINE) {
+        } else if (it.rowType === TraceRow.ROW_TYPE_HEAP_TIMELINE || it.rowType === TraceRow.ROW_TYPE_JS_MEMORY) {
+          selection.jsMemory.push(it.rowId);
+          let jsMemoryRows: Array> = [
+            ...this.shadowRoot!.querySelectorAll>(
+              `trace-row[row-parent-id='${it.rowId}']`
+            ),
+          ];
+          if (!it.expansion) {
+            jsMemoryRows = [...it.childrenList];
+          }
+          jsMemoryRows.forEach((th) => {
+            if (th.rowType === TraceRow.ROW_TYPE_HEAP_TIMELINE) {
+              it.dataList.length === 0 ? th.dataList : it.dataList;
+              selection.jsMemory.push(th.rowId);
+            } else {
+              selection.jsMemory = [];
+            }
+          });
           let endNS = TraceRow.rangeSelectObject?.endNS ? TraceRow.rangeSelectObject?.endNS : TraceRow.range?.endNS;
           let startNS = TraceRow.rangeSelectObject?.startNS
             ? TraceRow.rangeSelectObject?.startNS
             : TraceRow.range?.startNS;
           let minNodeId, maxNodeId;
-          if (!it.dataList) {
+          if (!it.dataList || it.dataList.length === 0) {
             return;
           }
           for (let sample of it.dataList) {
@@ -679,7 +623,7 @@ export class SpSystemTrace extends BaseElement {
               minNodeId = sample.lastAssignedId;
             }
             if (sample.timestamp * 1000 >= endNS!) {
-              if (maxNodeId == undefined) {
+              if (maxNodeId === undefined) {
                 maxNodeId = sample.lastAssignedId;
               }
             }
@@ -701,7 +645,6 @@ export class SpSystemTrace extends BaseElement {
             ?.querySelector('#box-heap-summary')
             ?.querySelector('tabpane-summary') as TabPaneSummary;
           summary.initSummaryData(SpJsMemoryChart.file, minNodeId, maxNodeId);
-          selection.jsMemory.push(1);
         }
         if (this.rangeTraceRow!.length !== rows.length) {
           let event = this.createPointEvent(it);
@@ -740,7 +683,6 @@ export class SpSystemTrace extends BaseElement {
       } else {
         this.traceSheetEL?.rangeSelect(selection);
       }
-      this.timerShaftEL!.selectionList.push(selection);// 保持选中对象,为后面的再次选中该框选区域做准备。
       this.selectionParam = selection;
     };
     // @ts-ignore
@@ -769,8 +711,7 @@ export class SpSystemTrace extends BaseElement {
             if (TraceRow.rangeSelectObject && SpSystemTrace.sliceRangeMark) {
               this.timerShaftEL?.setSlicesMark(
                 TraceRow.rangeSelectObject.startNS || 0,
-                TraceRow.rangeSelectObject.endNS || 0,
-                false
+                TraceRow.rangeSelectObject.endNS || 0
               );
               SpSystemTrace.sliceRangeMark = undefined;
               window.publish(window.SmartEvent.UI.RefreshCanvas, {});
@@ -821,7 +762,7 @@ export class SpSystemTrace extends BaseElement {
     window.subscribe(window.SmartEvent.UI.SliceMark, (data) => {
       this.sliceMarkEventHandler(data);
     });
-    window.subscribe(window.SmartEvent.UI.TraceRowComplete, (tr) => { });
+    window.subscribe(window.SmartEvent.UI.TraceRowComplete, (tr) => {});
     window.subscribe(window.SmartEvent.UI.RefreshCanvas, () => {
       this.refreshCanvas(false);
     });
@@ -833,6 +774,13 @@ export class SpSystemTrace extends BaseElement {
     });
   }
 
+  pushPidToSelection(selection: SelectionParam, id: string) {
+    let pid = parseInt(id);
+    if (!selection.processIds.includes(pid)) {
+      selection.processIds.push(pid);
+    }
+  }
+
   private createPointEvent(it: TraceRow) {
     let event = this.eventMap[it.rowType + ''];
     if (event) {
@@ -959,19 +907,6 @@ export class SpSystemTrace extends BaseElement {
     this.refreshCanvas(true, 'flagChange');
   };
 
-  timerShaftELRangeClick = (sliceTime: SlicesTime | undefined | null) => {
-    if (sliceTime) {
-      setTimeout(() => {
-        this.traceSheetEL?.displayCurrent(sliceTime); // 给当前pane准备数据            
-        let selection = this.timerShaftEL!.selectionMap.get(sliceTime.id);
-        if (selection) {
-          selection.isCurrentPane = true;  // 设置当前面板为可以显示的状态
-          this.traceSheetEL?.rangeSelect(selection);  // 显示选中区域对应的面板
-        }
-      }, 0);
-    }
-  };
-
   timerShaftELRangeChange = (e: any) => {
     TraceRow.range = e;
     if (TraceRow.rangeSelectObject) {
@@ -1088,18 +1023,14 @@ export class SpSystemTrace extends BaseElement {
       y: 0,
       width: this.timerShaftEL?.canvas?.clientWidth,
       height: this.canvasPanel?.clientHeight,
-    },
-      this.timerShaftEL!
-    );
+    });
     //draw flag line segment for favorite canvas
     drawFlagLineSegment(this.canvasFavoritePanelCtx, this.hoverFlag, this.selectFlag, {
       x: 0,
       y: 0,
       width: this.timerShaftEL?.canvas?.clientWidth,
       height: this.canvasFavoritePanel?.clientHeight,
-    },
-      this.timerShaftEL!
-    );
+    });
     //draw wakeup for main canvas
     drawWakeUp(
       this.canvasPanelCtx,
@@ -1128,38 +1059,6 @@ export class SpSystemTrace extends BaseElement {
         height: this.canvasFavoritePanel!.clientHeight!,
       } as Rect
     );
-    // draw wakeuplist for main canvas
-    for (let i = 0; i < SpSystemTrace.wakeupList.length; i++) {
-      if (i + 1 == SpSystemTrace.wakeupList.length) {
-        return
-      }
-      drawWakeUpList(
-        this.canvasPanelCtx,
-        SpSystemTrace.wakeupList[i + 1],
-        TraceRow.range!.startNS,
-        TraceRow.range!.endNS,
-        TraceRow.range!.totalNS,
-        {
-          x: 0,
-          y: 0,
-          width: this.timerShaftEL!.canvas!.clientWidth,
-          height: this.canvasPanel!.clientHeight!,
-        } as Rect,
-      )
-      drawWakeUpList(
-        this.canvasFavoritePanelCtx,
-        SpSystemTrace.wakeupList[i + 1],
-        TraceRow.range!.startNS,
-        TraceRow.range!.endNS,
-        TraceRow.range!.totalNS,
-        {
-          x: 0,
-          y: 0,
-          width: this.timerShaftEL!.canvas!.clientWidth,
-          height: this.canvasFavoritePanel!.clientHeight!,
-        } as Rect,
-      )
-    };
 
     // Draw the connection curve
     if (this.linkNodes) {
@@ -1187,15 +1086,11 @@ export class SpSystemTrace extends BaseElement {
         x > (TraceRow.rangeSelectObject?.startX || 0) &&
         x < (TraceRow.rangeSelectObject?.endX || 0)
       ) {
-        let findSlicestime = this.timerShaftEL!.sportRuler?.findSlicesTime(x, y); // 查找帽子  
-        if (!findSlicestime) { // 如果没有找到帽子,则绘制一个三角形的旗子
-          let time = Math.round(
-            (x * (TraceRow.range?.endNS! - TraceRow.range?.startNS!)) /
-            this.timerShaftEL!.canvas!.offsetWidth +
+        let time = Math.round(
+          (x * (TraceRow.range?.endNS! - TraceRow.range?.startNS!)) / this.timerShaftEL!.canvas!.offsetWidth +
             TraceRow.range?.startNS!
-          );
-          this.timerShaftEL!.sportRuler!.drawTriangle(time, 'triangle');
-        }
+        );
+        this.timerShaftEL!.sportRuler!.drawTriangle(time, 'triangle');
       } else {
         this.rangeSelect.mouseDown(ev);
         this.rangeSelect.drag = true;
@@ -1227,8 +1122,17 @@ export class SpSystemTrace extends BaseElement {
     this.rangeSelect.isMouseDown = false;
     if ((window as any).isSheetMove) return;
     if (this.isMouseInSheet(ev)) return;
-    this.rangeSelect.mouseUp(ev);
-    this.timerShaftEL?.documentOnMouseUp(ev);
+    let x = ev.offsetX - this.timerShaftEL!.canvas!.offsetLeft;
+    let y = ev.offsetY;
+    if (
+      this.timerShaftEL!.sportRuler!.frame.contains(x, y) &&
+      x > (TraceRow.rangeSelectObject?.startX || 0) &&
+      x < (TraceRow.rangeSelectObject?.endX || 0)
+    ) {
+    } else {
+      this.rangeSelect.mouseUp(ev);
+      this.timerShaftEL?.documentOnMouseUp(ev);
+    }
     ev.preventDefault();
     ev.stopPropagation();
   };
@@ -1259,24 +1163,7 @@ export class SpSystemTrace extends BaseElement {
     this.observerScrollHeightEnable = false;
     if (this.keyboardEnable) {
       if (keyPress == 'm') {
-        this.slicestime = this.setSLiceMark(ev.shiftKey);
-        // 设置currentPane可以显示,并且修改调色板颜色和刚刚绘制的帽子颜色保持一致。 
-        this.traceSheetEL = this.shadowRoot?.querySelector('.trace-sheet');
-        let currentPane = this.traceSheetEL?.displayTab('tabpane-current');
-        if (this.slicestime) {
-          currentPane?.setCurrentSlicesTime(this.slicestime)
-        }
-        // 显示对应的面板信息
-        this.timerShaftEL!.selectionList.forEach((selection, index) => {
-          if (this.timerShaftEL!.selectionList.length - 1 == index) {
-            // 把最新添加的 SelectionParam 对象设置为可以显示当前面板
-            selection.isCurrentPane = true;
-            this.traceSheetEL?.rangeSelect(selection);
-          } else {
-            // 其他 SelectionParam 对象设置为不显示当前面板
-            selection.isCurrentPane = false;
-          }
-        });
+        this.setSLiceMark();
       }
       let keyPressWASD = keyPress === 'w' || keyPress === 'a' || keyPress === 's' || keyPress === 'd';
       if (keyPressWASD) {
@@ -1289,52 +1176,37 @@ export class SpSystemTrace extends BaseElement {
     }
   };
 
-  setSLiceMark(shiftKey: boolean): SlicesTime | null | undefined {
+  setSLiceMark() {
     if (CpuStruct.selectCpuStruct) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
+      this.timerShaftEL?.setSlicesMark(
         CpuStruct.selectCpuStruct.startTime || 0,
-        (CpuStruct.selectCpuStruct.startTime || 0) +
-        (CpuStruct.selectCpuStruct.dur || 0),
-        shiftKey
+        (CpuStruct.selectCpuStruct.startTime || 0) + (CpuStruct.selectCpuStruct.dur || 0)
       );
     } else if (ThreadStruct.selectThreadStruct) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
+      this.timerShaftEL?.setSlicesMark(
         ThreadStruct.selectThreadStruct.startTime || 0,
-        (ThreadStruct.selectThreadStruct.startTime || 0) +
-        (ThreadStruct.selectThreadStruct.dur || 0),
-        shiftKey
+        (ThreadStruct.selectThreadStruct.startTime || 0) + (ThreadStruct.selectThreadStruct.dur || 0)
       );
     } else if (FuncStruct.selectFuncStruct) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
+      this.timerShaftEL?.setSlicesMark(
         FuncStruct.selectFuncStruct.startTs || 0,
-        (FuncStruct.selectFuncStruct.startTs || 0) +
-        (FuncStruct.selectFuncStruct.dur || 0),
-        shiftKey
+        (FuncStruct.selectFuncStruct.startTs || 0) + (FuncStruct.selectFuncStruct.dur || 0)
       );
     } else if (IrqStruct.selectIrqStruct) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
+      this.timerShaftEL?.setSlicesMark(
         IrqStruct.selectIrqStruct.startNS || 0,
-        (IrqStruct.selectIrqStruct.startNS || 0) +
-        (IrqStruct.selectIrqStruct.dur || 0),
-        shiftKey
+        (IrqStruct.selectIrqStruct.startNS || 0) + (IrqStruct.selectIrqStruct.dur || 0)
       );
     } else if (TraceRow.rangeSelectObject) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
-        TraceRow.rangeSelectObject.startNS || 0,
-        TraceRow.rangeSelectObject.endNS || 0,
-        shiftKey
-      );
+      this.timerShaftEL?.setSlicesMark(TraceRow.rangeSelectObject.startNS || 0, TraceRow.rangeSelectObject.endNS || 0);
     } else if (JankStruct.selectJankStruct) {
-      this.slicestime = this.timerShaftEL?.setSlicesMark(
+      this.timerShaftEL?.setSlicesMark(
         JankStruct.selectJankStruct.ts || 0,
-        (JankStruct.selectJankStruct.ts || 0) +
-        (JankStruct.selectJankStruct.dur || 0),
-        shiftKey
+        (JankStruct.selectJankStruct.ts || 0) + (JankStruct.selectJankStruct.dur || 0)
       );
     } else {
-      this.slicestime = this.timerShaftEL?.setSlicesMark();
+      this.timerShaftEL?.setSlicesMark();
     }
-    return this.slicestime;
   }
 
   stopWASD = () => {
@@ -1450,7 +1322,7 @@ export class SpSystemTrace extends BaseElement {
         this.hoverStructNull();
       }
       rows
-        .filter((it) => it.focusContain(ev,this.inFavoriteArea!) && it.collect === this.inFavoriteArea)
+        .filter((it) => it.focusContain(ev, this.inFavoriteArea!) && it.collect === this.inFavoriteArea)
         .filter((it) => {
           if (it.collect) {
             return true;
@@ -1560,7 +1432,7 @@ export class SpSystemTrace extends BaseElement {
     ) {
     } else {
       let inFavoriteArea = this.favoriteRowsEL?.containPoint(ev);
-      let rows = this.visibleRows.filter((it) => it.focusContain(ev,inFavoriteArea!) && it.collect == inFavoriteArea);
+      let rows = this.visibleRows.filter((it) => it.focusContain(ev, inFavoriteArea!) && it.collect == inFavoriteArea);
       if (JankStruct.delJankLineFlag) {
         this.clearPointPair();
       }
@@ -1582,7 +1454,6 @@ export class SpSystemTrace extends BaseElement {
     this.rangeSelect.rangeTraceRow = [];
     TraceRow.rangeSelectObject = undefined;
     this.selectStructNull();
-    this.wakeupListNull();
     this.observerScrollHeightEnable = false;
     this.selectFlag = null;
     this.timerShaftEL?.removeTriangle('inverted');
@@ -1635,7 +1506,6 @@ export class SpSystemTrace extends BaseElement {
     if (!this.loadTraceCompleted) return;
     this.shadowRoot?.querySelectorAll>('trace-row').forEach((it) => (it.rangeSelect = false));
     this.selectStructNull();
-    this.wakeupListNull();
     let threadClickHandler: any;
     let cpuClickHandler: any;
     let jankClickHandler: any;
@@ -1658,7 +1528,6 @@ export class SpSystemTrace extends BaseElement {
       }
       this.hoverStructNull();
       this.selectStructNull();
-      this.wakeupListNull();
       CpuStruct.hoverCpuStruct = findEntry;
       CpuStruct.selectCpuStruct = findEntry;
       this.timerShaftEL?.drawTriangle(findEntry!.startTime || 0, 'inverted');
@@ -1673,7 +1542,9 @@ export class SpSystemTrace extends BaseElement {
     };
 
     cpuClickHandler = (d: CpuStruct) => {
-      let traceRow = this.shadowRoot?.querySelector>(`trace-row[row-id='${d.processId}'][row-type='process']`);
+      let traceRow = this.shadowRoot?.querySelector>(
+        `trace-row[row-id='${d.processId}'][row-type='process']`
+      );
       if (traceRow) {
         traceRow.expansion = true;
       }
@@ -1695,7 +1566,6 @@ export class SpSystemTrace extends BaseElement {
           }
           this.hoverStructNull();
           this.selectStructNull();
-          this.wakeupListNull();
           ThreadStruct.hoverThreadStruct = findEntry;
           ThreadStruct.selectThreadStruct = findEntry;
           this.timerShaftEL?.drawTriangle(findEntry!.startTime || 0, 'inverted');
@@ -1745,7 +1615,6 @@ export class SpSystemTrace extends BaseElement {
             }
             this.hoverStructNull();
             this.selectStructNull();
-            this.wakeupListNull();
             JankStruct.hoverJankStruct = findJankEntry;
             JankStruct.selectJankStruct = findJankEntry;
             this.timerShaftEL?.drawTriangle(findJankEntry!.ts || 0, 'inverted');
@@ -1783,7 +1652,6 @@ export class SpSystemTrace extends BaseElement {
           let findEntry = snapshotRow!.dataList!.find((dat) => dat.startTs === d.startTs);
           this.hoverStructNull();
           this.selectStructNull();
-          this.wakeupListNull();
           HeapSnapshotStruct.hoverSnapshotStruct = findEntry;
           HeapSnapshotStruct.selectSnapshotStruct = findEntry;
         }
@@ -2077,56 +1945,12 @@ export class SpSystemTrace extends BaseElement {
     }
   }
 
-  myMouseMove = (ev: MouseEvent) => {
-    if (ev.ctrlKey) {
-      ev.preventDefault();
-      SpSystemTrace.offsetMouse =
-        ev.clientX - SpSystemTrace.mouseCurrentPosition;
-      let eventA = new KeyboardEvent('keypress', {
-        key: 'a',
-        code: '65',
-        keyCode: 65,
-      });
-      let eventD = new KeyboardEvent('keypress', {
-        key: 'd',
-        code: '68',
-        keyCode: 68,
-      });
-      if (ev.button == 0) {
-        if (
-          SpSystemTrace.offsetMouse < 0 &&
-          SpSystemTrace.moveable
-        ) {
-          // 向右拖动,则泳道图右移
-          this.timerShaftEL!.documentOnKeyPress(eventD);
-          setTimeout(() => {
-            this.timerShaftEL!.documentOnKeyUp(eventD);
-          }, 350);
-        }
-        if (
-          SpSystemTrace.offsetMouse > 0 &&
-          SpSystemTrace.moveable
-        ) {
-          // 向左拖动,则泳道图左移
-          this.timerShaftEL!.documentOnKeyPress(eventA);
-          setTimeout(() => {
-            this.timerShaftEL!.documentOnKeyUp(eventA);
-          }, 350);
-        }
-      }
-      SpSystemTrace.moveable = false;
-    }
-  }
-
-
-
   connectedCallback() {
     this.initPointToEvent();
     /**
      * 监听时间轴区间变化
      */
     this.timerShaftEL!.rangeChangeHandler = this.timerShaftELRangeChange;
-    this.timerShaftEL!.rangeClickHandler = this.timerShaftELRangeClick
     this.timerShaftEL!.flagChangeHandler = this.timerShaftELFlagChange;
     this.timerShaftEL!.flagClickHandler = this.timerShaftELFlagClickHandler;
     /**
@@ -2173,10 +1997,42 @@ export class SpSystemTrace extends BaseElement {
      */
     this.addEventListener(
       'mousemove',
-      ev => throttle(this.myMouseMove, 350, ev)(),
+      (e) => {
+        if (e.ctrlKey) {
+          e.preventDefault();
+          SpSystemTrace.offsetMouse = e.clientX - SpSystemTrace.mouseCurrentPosition;
+          let eventA = new KeyboardEvent('keypress', {
+            key: 'a',
+            code: '65',
+            keyCode: 65,
+          });
+          let eventD = new KeyboardEvent('keypress', {
+            key: 'd',
+            code: '68',
+            keyCode: 68,
+          });
+          if (e.button == 0) {
+            if (SpSystemTrace.offsetMouse < 0 && SpSystemTrace.moveable) {
+              // 向右拖动,则泳道图右移
+              this.timerShaftEL!.documentOnKeyPress(eventD);
+              setTimeout(() => {
+                this.timerShaftEL!.documentOnKeyUp(eventD);
+              }, 350);
+            }
+            if (SpSystemTrace.offsetMouse > 0 && SpSystemTrace.moveable) {
+              // 向左拖动,则泳道图左移
+              this.timerShaftEL!.documentOnKeyPress(eventA);
+              setTimeout(() => {
+                this.timerShaftEL!.documentOnKeyUp(eventA);
+              }, 350);
+            }
+          }
+          SpSystemTrace.moveable = false;
+        }
+      },
       { passive: false }
     );
-	
+
     this.addEventListener(
       'mouseup',
       (e) => {
@@ -2195,6 +2051,12 @@ export class SpSystemTrace extends BaseElement {
       { passive: false }
     );
 
+    /**
+     * 泳道图中添加ctrl+鼠标滚轮事件,对泳道图进行放大缩小。
+     * 鼠标滚轮事件转化为键盘事件,keyPress和keyUp两个事件需要配合使用,
+     * 否则泳道图会一直放大或一直缩小。
+     * setTimeout()函数中的时间参数可以控制鼠标滚轮的频率。
+     */
     document.addEventListener(
       'wheel',
       (e) => {
@@ -2377,7 +2239,6 @@ export class SpSystemTrace extends BaseElement {
     });
     this.rangeSelect.rangeTraceRow = [];
     this.selectStructNull();
-    this.wakeupListNull();
     this.traceSheetEL?.setAttribute('mode', 'hidden');
     this.clearPointPair();
     TraceRow.range!.refresh = true;
@@ -2608,7 +2469,6 @@ export class SpSystemTrace extends BaseElement {
           let searchEntry = filterRow!.dataList!.find((dat) => dat.startTime === findEntry.startTime);
           this.hoverStructNull();
           this.selectStructNull();
-          this.wakeupListNull();
           ThreadStruct.hoverThreadStruct = searchEntry;
           ThreadStruct.selectThreadStruct = searchEntry;
           this.scrollToProcess(`${findEntry.rowId}`, `${findEntry.rowParentId}`, findEntry.rowType, true);
@@ -2629,7 +2489,6 @@ export class SpSystemTrace extends BaseElement {
       }
       this.hoverStructNull();
       this.selectStructNull();
-      this.wakeupListNull();
       this.onClickHandler(findEntry.rowType!);
       this.closeAllExpandRows(findEntry.rowParentId);
       this.scrollToProcess(`${findEntry.rowId}`, `${findEntry.rowParentId}`, findEntry.rowType, true);
@@ -2642,7 +2501,6 @@ export class SpSystemTrace extends BaseElement {
     const toTargetDepth = (entry: any) => {
       this.hoverStructNull();
       this.selectStructNull();
-      this.wakeupListNull();
       FuncStruct.hoverFuncStruct = entry;
       FuncStruct.selectFuncStruct = entry;
       this.onClickHandler(TraceRow.ROW_TYPE_FUNC);
@@ -2685,7 +2543,7 @@ export class SpSystemTrace extends BaseElement {
       completeEntry();
     } else {
       this.scrollToProcess(`${funcStract.tid}`, `${funcStract.pid}`, 'process', false);
-      this.scrollToProcess(`${funcStract.tid}`, `${funcStract.pid}`, 'func', true);
+      this.scrollToProcess(`${funcStract.tid}`, `${funcStract.pid}`, 'thread', false);
       filterRow!.onComplete = completeEntry;
     }
   }
@@ -2824,9 +2682,9 @@ export class SpSystemTrace extends BaseElement {
     this.loadTraceCompleted = false;
     this.collectRows = [];
     this.visibleRows = [];
-    TraceRowConfig.allTraceRowList.forEach(it => {
+    TraceRowConfig.allTraceRowList.forEach((it) => {
       it.clearMemory();
-    })
+    });
     TraceRowConfig.allTraceRowList = [];
     if (this.favoriteRowsEL) {
       this.favoriteRowsEL.querySelectorAll>(`trace-row`).forEach((row) => {
@@ -2839,7 +2697,7 @@ export class SpSystemTrace extends BaseElement {
         row.clearMemory();
         this.rowsEL!.removeChild(row);
       });
-      this.rowsEL.innerHTML = ''
+      this.rowsEL.innerHTML = '';
     }
     this.traceSheetEL?.clearMemory();
     this.spacerEL!.style.height = '0px';
@@ -2851,7 +2709,6 @@ export class SpSystemTrace extends BaseElement {
     CpuStruct.wakeupBean = undefined;
     this.selectStructNull();
     this.hoverStructNull();
-    this.wakeupListNull();
     this.traceSheetEL?.setAttribute('mode', 'hidden');
     progress && progress('rest timershaft', 8);
     this.timerShaftEL?.reset();
@@ -2859,8 +2716,8 @@ export class SpSystemTrace extends BaseElement {
     HeapDataInterface.getInstance().clearData();
     procedurePool.clearCache();
     Utils.clearData();
-    procedurePool.submitWithName('logic0', 'clear', {}, undefined, (res: any) => { });
-    procedurePool.submitWithName('logic1', 'clear', {}, undefined, (res: any) => { });
+    procedurePool.submitWithName('logic0', 'clear', {}, undefined, (res: any) => {});
+    procedurePool.submitWithName('logic1', 'clear', {}, undefined, (res: any) => {});
   }
 
   init = async (param: { buf?: ArrayBuffer; url?: string }, wasmConfigUri: string, progress: Function) => {
@@ -2994,18 +2851,6 @@ export class SpSystemTrace extends BaseElement {
       }
     }
   }
-  queryCPUWakeUpList(data: WakeupBean) {
-    TabPaneCurrentSelection.queryCPUWakeUpListFromBean(data).then((a: any) => {
-      if (a === null) {
-        return null
-      }
-      SpSystemTrace.wakeupList.push(a);
-      this.queryCPUWakeUpList(a);
-    });
-  }
-  wakeupListNull() {
-    SpSystemTrace.wakeupList = [];
-  }
 
   initPointToEvent() {
     this.eventMap = {
diff --git a/ide/src/trace/component/chart/SpChartManager.ts b/ide/src/trace/component/chart/SpChartManager.ts
index e0512d73..06bc4670 100644
--- a/ide/src/trace/component/chart/SpChartManager.ts
+++ b/ide/src/trace/component/chart/SpChartManager.ts
@@ -115,8 +115,6 @@ export class SpChartManager {
     progress('fps', 85);
     await this.fps.init();
     info('FPS Data initialized');
-    progress('native memory', 86);
-    await this.nativeMemory.initNativeMemory();
     progress('native memory', 87);
     await this.nativeMemory.initChart();
     info('Native Memory Data initialized');
diff --git a/ide/src/trace/component/chart/SpJsMemoryChart.ts b/ide/src/trace/component/chart/SpJsMemoryChart.ts
index 0a612cba..d173e674 100644
--- a/ide/src/trace/component/chart/SpJsMemoryChart.ts
+++ b/ide/src/trace/component/chart/SpJsMemoryChart.ts
@@ -37,6 +37,8 @@ export class SpJsMemoryChart implements ParseListener {
       let jsHeapRow = TraceRow.skeleton();
       let process = '';
       let heapFile = HeapDataInterface.getInstance().getFileStructs();
+      let file = heapFile[0];
+      let samples = HeapDataInterface.getInstance().getSamples(file.id);
       process = String(heapFile[0].pid);
       jsHeapRow.rowId = `js-memory`;
       jsHeapRow.index = 0;
@@ -49,7 +51,7 @@ export class SpJsMemoryChart implements ParseListener {
       jsHeapRow.favoriteChangeHandler = this.trace.favoriteChangeHandler;
       jsHeapRow.selectChangeHandler = this.trace.selectChangeHandler;
       jsHeapRow.onDrawTypeChangeHandler = (type) => {};
-      jsHeapRow.supplier = () => new Promise>((resolve) => resolve([]));
+      jsHeapRow.supplier = () => new Promise>((resolve) => resolve(samples));
       jsHeapRow.onThreadHandler = (useCache) => {
         jsHeapRow.canvasSave(this.trace.canvasPanelCtx!);
         if (jsHeapRow.expansion) {
@@ -67,10 +69,8 @@ export class SpJsMemoryChart implements ParseListener {
         jsHeapRow.canvasRestore(this.trace.canvasPanelCtx!);
       };
       this.trace.rowsEL?.appendChild(jsHeapRow);
-      let file = heapFile[0];
       SpJsMemoryChart.file = file;
       if (file.name.includes('Timeline')) {
-        let samples = HeapDataInterface.getInstance().getSamples(file.id);
         let heapTimelineRow = TraceRow.skeleton();
         heapTimelineRow.index = 0;
         heapTimelineRow.rowParentId = `js-memory`;
diff --git a/ide/src/trace/component/chart/SpNativeMemoryChart.ts b/ide/src/trace/component/chart/SpNativeMemoryChart.ts
index 1dfd5aca..990412d9 100644
--- a/ide/src/trace/component/chart/SpNativeMemoryChart.ts
+++ b/ide/src/trace/component/chart/SpNativeMemoryChart.ts
@@ -51,6 +51,7 @@ export class SpNativeMemoryChart {
     if (nativeProcess.length == 0) {
       return;
     }
+    await this.initNativeMemory();
     SpNativeMemoryChart.EVENT_HEAP = await queryHeapGroupByEvent(nativeMemoryType);
     let nativeRow = TraceRow.skeleton();
     let process = '';
diff --git a/ide/src/trace/component/chart/SpProcessChart.ts b/ide/src/trace/component/chart/SpProcessChart.ts
index 30322cbb..90f2f2d2 100644
--- a/ide/src/trace/component/chart/SpProcessChart.ts
+++ b/ide/src/trace/component/chart/SpProcessChart.ts
@@ -595,7 +595,7 @@ export class SpProcessChart {
         threadRow.favoriteChangeHandler = this.trace.favoriteChangeHandler;
         threadRow.selectChangeHandler = this.trace.selectChangeHandler;
         threadRow.supplier = () =>
-          queryThreadData(thread.tid || 0).then((res) => {
+          queryThreadData(thread.tid || 0, it.pid || 0).then((res) => {
             if (res.length <= 0) {
               threadRow.rowDiscard = true;
               this.trace.refreshCanvas(true);
@@ -642,7 +642,7 @@ export class SpProcessChart {
           funcRow.name = `${thread.threadName || 'Thread'} ${thread.tid}`;
           funcRow.setAttribute('children', '');
           funcRow.supplier = () =>
-            getFunDataByTid(thread.tid || 0).then((funs: Array) => {
+            getFunDataByTid(thread.tid || 0, it.pid || 0).then((funs: Array) => {
               if (funs.length > 0) {
                 let isBinder = (data: FuncStruct): boolean => {
                   return (
diff --git a/ide/src/trace/component/metrics/CpuStrategy.ts b/ide/src/trace/component/metrics/CpuStrategy.ts
index 42ab450f..18603eef 100644
--- a/ide/src/trace/component/metrics/CpuStrategy.ts
+++ b/ide/src/trace/component/metrics/CpuStrategy.ts
@@ -15,40 +15,15 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initTest = (metricData: Array): ProcessInfoListItem => {
-  let processInfoListItems: Array = [];
-  for (let index = 0; index < metricData.length; index++) {
-    let eventName = metricData[index].event_name;
-    let stat_type = metricData[index].stat_type;
-    let count = metricData[index].count;
-    let source = metricData[index].source;
-    let serverity = metricData[index].serverity;
-
-    let processInfoSource: ProcessInfoItem = {
-      // @ts-ignore
-      processName: eventName,
-      threads: {
-        // @ts-ignore
-        threadName: stat_type,
-        cpu: [
-          {
-            cpu: eventName,
-            minFreq: stat_type,
-            maxFreq: count,
-            avgFrequency: source,
-            duration: serverity,
-          },
-        ],
-      },
-    };
-    processInfoListItems?.push(processInfoSource);
-  }
-  return {
-    processInfo: processInfoListItems,
-  };
-};
-
-export const initCpuStrategyData = (metricData: Array): ProcessInfoListItem => {
+export const initCpuStrategyData = (metricData: Array<{
+  tid: string;
+  pid: string;
+  cpu: string;
+  dur: string;
+  min_freq: string;
+  max_freq: string;
+  avg_frequency: string;
+}>): ProcessInfoListItem => {
   info('Cpu Strategy data length is:', metricData.length);
   let processInfoListItems: Array = [];
   if (metricData.length == 10) {
diff --git a/ide/src/trace/component/metrics/DistributeTermStrategy.ts b/ide/src/trace/component/metrics/DistributeTermStrategy.ts
index 67bc60e8..faf65092 100644
--- a/ide/src/trace/component/metrics/DistributeTermStrategy.ts
+++ b/ide/src/trace/component/metrics/DistributeTermStrategy.ts
@@ -15,7 +15,20 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initDistributedTermData = (metricData: Array): DistributedTermListItem => {
+export const initDistributedTermData = (metricData: Array<{
+  threadId: string;
+  threadName: string;
+  processId: string;
+  processName: string;
+  funName: string;
+  dur: string;
+  ts: string;
+  chainId: string;
+  spanId: string;
+  parentSpanId: string;
+  flag: string;
+  trace_name: string;
+}>): DistributedTermListItem => {
   info('Distributed Term data length is:', metricData.length);
   let distributedTermListItems: Array = [];
   const splitChar = ',';
@@ -46,8 +59,8 @@ export const initDistributedTermData = (metricData: Array): DistributedTerm
       let delay: number = 0;
       if (flag.indexOf('S,C') > -1 || flag.indexOf('C,S') > -1) {
         across = false;
-        if (flagList[index] == 'S') receiverTime = timeList[index];
-        if (flagList[index] == 'C') senderTime = timeList[index];
+        if (flagList[index] == 'S') receiverTime = Number(timeList[index]);
+        if (flagList[index] == 'C') senderTime = Number(timeList[index]);
         delay = receiverTime - senderTime;
       }
 
diff --git a/ide/src/trace/component/metrics/MemAggStrategy.ts b/ide/src/trace/component/metrics/MemAggStrategy.ts
index 0d7a2412..a65624fe 100644
--- a/ide/src/trace/component/metrics/MemAggStrategy.ts
+++ b/ide/src/trace/component/metrics/MemAggStrategy.ts
@@ -15,7 +15,12 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initMemoryAggStrategy = (metricData: Array): ProcessValuesListItem => {
+export const initMemoryAggStrategy = (metricData: Array<{
+  processName: string;
+  name: string;
+  value: string;
+  ts: string;
+}>): ProcessValuesListItem => {
   info('Memory Agg Strategy data length is:', metricData.length);
   let processValuesListItems: Array = [];
   const splitChar: string = ',';
@@ -36,7 +41,7 @@ export const initMemoryAggStrategy = (metricData: Array): ProcessValuesList
       let names = metricData[sqlIndex].name.split(splitChar);
       let values = metricData[sqlIndex].value.split(splitChar);
       let times = metricData[sqlIndex].ts.split(splitChar);
-      let oomScoreValue = 0;
+      let oomScoreValue = '0';
       for (let indexScore = 0; indexScore < names.length; indexScore++) {
         if ('oom_score_adj' === names[indexScore]) {
           oomScoreValue = values[indexScore];
@@ -84,7 +89,7 @@ export interface ProcessValuesItem {
 }
 
 export interface TypeItem {
-  ts: number;
-  oom_score: number;
-  value: number;
+  ts: string;
+  oom_score: string;
+  value: string;
 }
diff --git a/ide/src/trace/component/metrics/MemStrategy.ts b/ide/src/trace/component/metrics/MemStrategy.ts
index f7ad94fd..fbe52fc8 100644
--- a/ide/src/trace/component/metrics/MemStrategy.ts
+++ b/ide/src/trace/component/metrics/MemStrategy.ts
@@ -15,7 +15,13 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initMemoryStrategy = (metricData: Array): ProcessMetricsListItems => {
+export const initMemoryStrategy = (metricData: Array<{
+  maxNum: number;
+  minNum: number;
+  avgNum: number;
+  name: string;
+  processName: string;
+}>): ProcessMetricsListItems => {
   info('Memory Strategy data length is:', metricData.length);
   let processMetricsListItems: Array = [];
   for (let sqlIndex = 0; sqlIndex < metricData.length; sqlIndex++) {
diff --git a/ide/src/trace/component/metrics/MetaDataStrategy.ts b/ide/src/trace/component/metrics/MetaDataStrategy.ts
index 70e75a90..49b4c3f3 100644
--- a/ide/src/trace/component/metrics/MetaDataStrategy.ts
+++ b/ide/src/trace/component/metrics/MetaDataStrategy.ts
@@ -15,7 +15,10 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initMetaDataStrategy = (metricData: Array): TraceMetadata => {
+export const initMetaDataStrategy = (metricData: Array<{
+  name: string;
+  valueText: string;
+}>): TraceMetadata => {
   info('Meta Strategy data length is:', metricData.length);
   let traceMetaDataList: Array = [];
   let statDataArray = [];
diff --git a/ide/src/trace/component/metrics/SysCallsStrategy.ts b/ide/src/trace/component/metrics/SysCallsStrategy.ts
index b57d6cb0..4483113d 100644
--- a/ide/src/trace/component/metrics/SysCallsStrategy.ts
+++ b/ide/src/trace/component/metrics/SysCallsStrategy.ts
@@ -15,7 +15,13 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initSysCallsStrategy = (metricData: Array): FunctionListItem => {
+export const initSysCallsStrategy = (metricData: Array<{
+  frequency: string;
+  minDur: string;
+  maxDur: string;
+  avgDur: number;
+  funName: string;
+}>): FunctionListItem => {
   info('System Calls Strategy data length is:', metricData.length);
   let functionListItems: Array = [];
   for (let sqlIndex = 0; sqlIndex < metricData.length; sqlIndex++) {
diff --git a/ide/src/trace/component/metrics/SysCallsTopStrategy.ts b/ide/src/trace/component/metrics/SysCallsTopStrategy.ts
index a78a726d..5acad758 100644
--- a/ide/src/trace/component/metrics/SysCallsTopStrategy.ts
+++ b/ide/src/trace/component/metrics/SysCallsTopStrategy.ts
@@ -15,7 +15,15 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initSysCallsTopStrategy = (metricData: Array): ProcessInfoListItem => {
+export const initSysCallsTopStrategy = (metricData: Array<{
+  tid: string;
+  pid: string;
+  funName: string;
+  frequency: string;
+  minDur: number;
+  maxDur: number;
+  avgDur: number;
+}>): ProcessInfoListItem => {
   info('System Calls Strategy data length is:', metricData.length);
   let ProcessInfoListItems: Array = [];
 
@@ -25,7 +33,7 @@ export const initSysCallsTopStrategy = (metricData: Array): ProcessInfoList
     let functionNames = metricData[sqlIndex].funName;
     let durMaxes = metricData[sqlIndex].maxDur;
     let durMines = metricData[sqlIndex].minDur < 0 ? 0 : metricData[sqlIndex].minDur;
-    let durAvgs = Math.floor(metricData[sqlIndex].avgDur).toString();
+    let durAvgs = Math.floor(metricData[sqlIndex].avgDur);
 
     let processInfoItem: ProcessInfoItem = {
       pid: pidList,
@@ -62,7 +70,7 @@ export interface ThreadsItem {
 
 export interface FunctionItem {
   functionName: string;
-  durMax: string;
-  durMin: string;
-  durAvg: string;
+  durMax: number;
+  durMin: number;
+  durAvg: number;
 }
diff --git a/ide/src/trace/component/metrics/TraceStatsStrategy.ts b/ide/src/trace/component/metrics/TraceStatsStrategy.ts
index dee35e86..ef3498f3 100644
--- a/ide/src/trace/component/metrics/TraceStatsStrategy.ts
+++ b/ide/src/trace/component/metrics/TraceStatsStrategy.ts
@@ -15,7 +15,13 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initTraceStateStrategy = (metricData: Array): StatListItem => {
+export const initTraceStateStrategy = (metricData: Array<{
+  event_name: string;
+  stat_type: string;
+  count: number;
+  source: string;
+  serverity: string;
+}>): StatListItem => {
   info('Trace State Strategy data length is:', metricData.length);
   let statListItems: Array = [];
   for (let sqlIndex = 0; sqlIndex < metricData.length; sqlIndex++) {
@@ -42,7 +48,7 @@ export interface StatListItem {
 
 export interface StatItem {
   name: string;
-  count: string;
+  count: number;
   source: string;
   severity: string;
 }
diff --git a/ide/src/trace/component/metrics/TraceTaskStrategy.ts b/ide/src/trace/component/metrics/TraceTaskStrategy.ts
index 6c498cab..7d9c8e3a 100644
--- a/ide/src/trace/component/metrics/TraceTaskStrategy.ts
+++ b/ide/src/trace/component/metrics/TraceTaskStrategy.ts
@@ -15,7 +15,12 @@
 
 import { info } from '../../../log/Log.js';
 
-export const initTraceTaskStrategy = (metricData: Array): ProcessListItem => {
+export const initTraceTaskStrategy = (metricData: Array<{
+  id: string;
+  pid: string;
+  process_name: string;
+  thread_name: string;
+}>): ProcessListItem => {
   info('Trace Task Strategy data length is:', metricData.length);
   let statListItems = [];
   for (let sqlIndex = 0; sqlIndex < metricData.length; sqlIndex++) {
diff --git a/ide/src/trace/component/setting/SpAllocations.ts b/ide/src/trace/component/setting/SpAllocations.ts
index e8566cd5..97c511bb 100644
--- a/ide/src/trace/component/setting/SpAllocations.ts
+++ b/ide/src/trace/component/setting/SpAllocations.ts
@@ -111,7 +111,7 @@ export class SpAllocations extends BaseElement {
     this.processId = this.shadowRoot?.getElementById('pid') as LitAllocationSelect;
     let input = this.processId.shadowRoot?.querySelector('.multipleSelect') as HTMLDivElement;
     let sp = document.querySelector('sp-application') as SpApplication;
-    let litSearch = sp?.shadowRoot?.querySelector('#lit-search') as LitSearch;
+    let litSearch = sp?.shadowRoot?.querySelector('#lit-record-search') as LitSearch;
     let allocationProcessData: Array = [];
     input.addEventListener('mousedown', (ev) => {
       if (SpRecordTrace.serialNumber == '') {
@@ -124,56 +124,10 @@ export class SpAllocations extends BaseElement {
     input.addEventListener('inputClick', () => {
       allocationProcessData = [];
       if (SpRecordTrace.serialNumber != '') {
-        if (SpRecordTrace.isVscode) {
-          let cmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]);
-          Cmd.execHdcCmd(cmd, (res: string) => {
-            let allocationsValuesVs: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-            for (let lineVal of allocationsValuesVs) {
-              if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                continue;
-              }
-              let allocationsVsProcess: string[] = lineVal.trim().split(' ');
-              if (allocationsVsProcess.length == 2) {
-                let processId = allocationsVsProcess[0];
-                let processName = allocationsVsProcess[1];
-                allocationProcessData.push(processName + '(' + processId + ')');
-              }
-            }
-            this.processId!.processData = allocationProcessData;
-            this.processId!.initData();
-          });
-        } else {
-          HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((rr) => {
-            if (sp.search) {
-              sp.search = false;
-              litSearch.clear();
-            }
-            if (rr) {
-              HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((res) => {
-                if (res) {
-                  let allocationsConfigValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-                  for (let lineVal of allocationsConfigValues) {
-                    if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                      continue;
-                    }
-                    let allocationsConfigProcess: string[] = lineVal.trim().split(' ');
-                    if (allocationsConfigProcess.length == 2) {
-                      let processId = allocationsConfigProcess[0];
-                      let processName = allocationsConfigProcess[1];
-                      allocationProcessData.push(processName + '(' + processId + ')');
-                    }
-                  }
-                }
-                this.processId!.processData = allocationProcessData;
-                this.processId!.initData();
-              });
-            } else {
-              sp.search = true;
-              litSearch.clear();
-              litSearch.setPercent('please kill other hdc-server! ', -2);
-            }
-          });
-        }
+        Cmd.getProcess().then((processList) => {
+          this.processId!.processData = processList;
+          this.processId!.initData();
+        });
       }
     });
     this.unwindEL = this.shadowRoot?.getElementById('unwind') as HTMLInputElement;
diff --git a/ide/src/trace/component/setting/SpCheckDesBox.ts b/ide/src/trace/component/setting/SpCheckDesBox.ts
index 57918df3..584258e5 100644
--- a/ide/src/trace/component/setting/SpCheckDesBox.ts
+++ b/ide/src/trace/component/setting/SpCheckDesBox.ts
@@ -14,7 +14,7 @@
  */
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
-import { LitCheckBox } from '../../../base-ui/checkbox/LitCheckBox.js';
+import { LitCheckBox, LitCheckBoxChangeEvent } from '../../../base-ui/checkbox/LitCheckBox.js';
 
 @element('check-des-box')
 export class SpCheckDesBox extends BaseElement {
@@ -83,9 +83,9 @@ lit-check-box {
   }
 
   public connectedCallback() {
-    this._checkBox?.addEventListener('change', (ev: any) => {
+    this._checkBox?.addEventListener('change', (ev: CustomEventInit) => {
       let detail = ev.detail;
-      this.checked = detail.checked;
+      this.checked = detail!.checked;
       this.dispatchEvent(new CustomEvent('onchange', { detail }));
     });
   }
diff --git a/ide/src/trace/component/setting/SpFileSystem.ts b/ide/src/trace/component/setting/SpFileSystem.ts
index 7a3cfef2..ebdebb8e 100644
--- a/ide/src/trace/component/setting/SpFileSystem.ts
+++ b/ide/src/trace/component/setting/SpFileSystem.ts
@@ -15,7 +15,7 @@
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
 import { LitSelectV } from '../../../base-ui/select/LitSelectV.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import '../../../base-ui/select/LitSelectV.js';
 import '../../../base-ui/select/LitSelect.js';
 
@@ -33,9 +33,6 @@ export class SpFileSystem extends BaseElement {
   private selectProcess: HTMLInputElement | undefined | null;
 
   private configList: Array = [];
-  private list: Array = [];
-
-  private eventList: Array = ['open', 'close', 'read', 'write'];
 
   set startRecord(start: boolean) {
     if (start) {
@@ -194,9 +191,9 @@ export class SpFileSystem extends BaseElement {
             fileSystemSwitch.checked = false;
           }
           if (config.title == 'Start FileSystem Record') {
-            fileSystemSwitch.addEventListener('change', (event: any) => {
+            fileSystemSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startFileSystem = true;
               } else {
                 this.startFileSystem = false;
@@ -204,9 +201,9 @@ export class SpFileSystem extends BaseElement {
             });
           }
           if (config.title == 'Start Page Fault Record') {
-            fileSystemSwitch.addEventListener('change', (event: any) => {
+            fileSystemSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startVirtualMemory = true;
               } else {
                 this.startVirtualMemory = false;
@@ -214,9 +211,9 @@ export class SpFileSystem extends BaseElement {
             });
           }
           if (config.title == 'Start BIO Latency Record') {
-            fileSystemSwitch.addEventListener('change', (event: any) => {
+            fileSystemSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startIo = true;
               } else {
                 this.startIo = false;
@@ -242,7 +239,6 @@ export class SpFileSystem extends BaseElement {
       }
     });
     this.selectProcess = this.processInput!.shadowRoot?.querySelector('input') as HTMLInputElement;
-    let fileSystemProcessData: Array = [];
     this.selectProcess!.addEventListener('mousedown', (ev) => {
       if (SpRecordTrace.serialNumber == '') {
         this.processInput!.dataSource([], '');
@@ -253,54 +249,12 @@ export class SpFileSystem extends BaseElement {
       if (SpRecordTrace.serialNumber == '') {
         this.processInput?.dataSource([], 'ALL-Process');
       } else {
-        if (SpRecordTrace.isVscode) {
-          let cmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]);
-          Cmd.execHdcCmd(cmd, (res: string) => {
-            fileSystemProcessData = [];
-            let fileSystemValuesVs: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-            for (let lineVal of fileSystemValuesVs) {
-              if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                continue;
-              }
-              let fileSystemProcessVs: string[] = lineVal.trim().split(' ');
-              if (fileSystemProcessVs.length == 2) {
-                let processId = fileSystemProcessVs[0];
-                let processName = fileSystemProcessVs[1];
-                fileSystemProcessData.push(processName + '(' + processId + ')');
-              }
-            }
-            if (fileSystemProcessData.length > 0 && this.startRecord) {
-              this.processInput!.setAttribute('readonly', 'readonly');
-            }
-            this.processInput?.dataSource(fileSystemProcessData, 'ALL-Process');
-          });
-        } else {
-          HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => {
-            if (conn) {
-              HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((res) => {
-                fileSystemProcessData = [];
-                if (res) {
-                  let fileSystemValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-                  for (let lineVal of fileSystemValues) {
-                    if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                      continue;
-                    }
-                    let fileSystemProcess: string[] = lineVal.trim().split(' ');
-                    if (fileSystemProcess.length == 2) {
-                      let processId = fileSystemProcess[0];
-                      let processName = fileSystemProcess[1];
-                      fileSystemProcessData.push(processName + '(' + processId + ')');
-                    }
-                  }
-                }
-                if (fileSystemProcessData.length > 0 && this.startRecord) {
-                  this.selectProcess!.setAttribute('readonly', 'readonly');
-                }
-                this.processInput?.dataSource(fileSystemProcessData, 'ALL-Process');
-              });
-            }
-          });
-        }
+        Cmd.getProcess().then((processList) => {
+          if (processList.length > 0 && this.startRecord) {
+            this.processInput!.setAttribute('readonly', 'readonly');
+          }
+          this.processInput?.dataSource(processList, 'ALL-Process');
+        });
       }
     });
     this.disable();
diff --git a/ide/src/trace/component/setting/SpHisysEvent.ts b/ide/src/trace/component/setting/SpHisysEvent.ts
index c0105ca3..3c75eaf3 100644
--- a/ide/src/trace/component/setting/SpHisysEvent.ts
+++ b/ide/src/trace/component/setting/SpHisysEvent.ts
@@ -14,7 +14,7 @@
  */
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import '../../../base-ui/select/LitAllocationSelect.js';
 
 import '../../../base-ui/switch/lit-switch.js';
@@ -88,9 +88,9 @@ export class SpHisysEvent extends BaseElement {
             hisysEventSwitch.checked = false;
           }
           if (config.title == 'Start Hisystem Event Tracker Record') {
-            hisysEventSwitch.addEventListener('change', (event: any) => {
+            hisysEventSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startSamp = true;
                 this.unDisable();
               } else {
diff --git a/ide/src/trace/component/setting/SpJsHeap.ts b/ide/src/trace/component/setting/SpJsHeap.ts
index 74f14a04..0cf21bba 100644
--- a/ide/src/trace/component/setting/SpJsHeap.ts
+++ b/ide/src/trace/component/setting/SpJsHeap.ts
@@ -20,8 +20,6 @@ import '../../../base-ui/switch/lit-switch.js';
 import { LitAllocationSelect } from '../../../base-ui/select/LitAllocationSelect.js';
 import { SpRecordTrace } from '../SpRecordTrace.js';
 import { Cmd } from '../../../command/Cmd.js';
-import { CmdConstant } from '../../../command/CmdConstant.js';
-import { HdcDeviceManager } from '../../../hdc/HdcDeviceManager.js';
 import { LitRadioBox } from '../../../base-ui/radiobox/LitRadioBox.js';
 import { SpCheckDesBox } from './SpCheckDesBox.js';
 
@@ -77,7 +75,6 @@ export class SpJsHeap extends BaseElement {
     this.interval = this.shadowRoot?.querySelector('#interval');
     this.processInput = this.shadowRoot?.querySelector('lit-allocation-select');
     let processInput = this.processInput?.shadowRoot?.querySelector('.multipleSelect') as HTMLDivElement;
-    let processData: Array = [];
     processInput!.addEventListener('mousedown', (ev) => {
       if (SpRecordTrace.serialNumber == '') {
         this.processInput!.processData = [];
@@ -89,50 +86,10 @@ export class SpJsHeap extends BaseElement {
         this.processInput!.processData = [];
         this.processInput!.initData();
       } else {
-        if (SpRecordTrace.isVscode) {
-          let cmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]);
-          Cmd.execHdcCmd(cmd, (res: string) => {
-            processData = [];
-            let lineValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-            for (let lineVal of lineValues) {
-              if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                continue;
-              }
-              let process: string[] = lineVal.trim().split(' ');
-              if (process.length == 2) {
-                let processId = process[0];
-                let processName = process[1];
-                processData.push(processName + '(' + processId + ')');
-              }
-            }
-            this.processInput!.processData = processData;
-            this.processInput!.initData();
-          });
-        } else {
-          HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => {
-            if (conn) {
-              HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((res) => {
-                processData = [];
-                if (res) {
-                  let lineValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-                  for (let lineVal of lineValues) {
-                    if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                      continue;
-                    }
-                    let process: string[] = lineVal.trim().split(' ');
-                    if (process.length == 2) {
-                      let processId = process[0];
-                      let processName = process[1];
-                      processData.push(processName + '(' + processId + ')');
-                    }
-                  }
-                }
-                this.processInput!.processData = processData;
-                this.processInput!.initData();
-              });
-            }
-          });
-        }
+        Cmd.getDebugProcess().then((processList) => {
+          this.processInput!.processData = processList;
+          this.processInput!.initData();
+        });
       }
     });
     this.interval!.addEventListener('focusout', () => {
diff --git a/ide/src/trace/component/setting/SpProbesConfig.ts b/ide/src/trace/component/setting/SpProbesConfig.ts
index c13b2281..bcf541dd 100644
--- a/ide/src/trace/component/setting/SpProbesConfig.ts
+++ b/ide/src/trace/component/setting/SpProbesConfig.ts
@@ -15,7 +15,7 @@
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
 import { checkDesBean, SpCheckDesBox } from './SpCheckDesBox.js';
-import { LitCheckBox } from '../../../base-ui/checkbox/LitCheckBox.js';
+import { LitCheckBox, LitCheckBoxChangeEvent } from '../../../base-ui/checkbox/LitCheckBox.js';
 import { LitRadioGroup } from '../../../base-ui/radiobox/LitRadioGroup.js';
 import { info, log } from '../../../log/Log.js';
 import { LitSlider } from '../../../base-ui/slider/LitSlider';
@@ -122,7 +122,7 @@ export class SpProbesConfig extends BaseElement {
       checkDesBox.value = configBean.value;
       checkDesBox.checked = configBean.isSelect;
       checkDesBox.des = configBean.des;
-      checkDesBox.addEventListener('onchange', (ev: any) => {
+      checkDesBox.addEventListener('onchange', () => {
         this.dispatchEvent(new CustomEvent('addProbe', {}));
       });
       this._traceConfig?.appendChild(checkDesBox);
@@ -148,7 +148,7 @@ export class SpProbesConfig extends BaseElement {
       checkDesBox.value = configBean.value;
       checkDesBox.checked = configBean.isSelect;
       checkDesBox.des = configBean.des;
-      checkDesBox.addEventListener('onchange', (ev: any) => {
+      checkDesBox.addEventListener('onchange', () => {
         this.dispatchEvent(new CustomEvent('addProbe', {}));
       });
       this._memoryConfig?.appendChild(checkDesBox);
@@ -166,7 +166,7 @@ export class SpProbesConfig extends BaseElement {
       checkDesBox.value = configBean.value;
       checkDesBox.checked = configBean.isSelect;
       checkDesBox.des = configBean.des;
-      checkDesBox.addEventListener('onchange', (ev: any) => {
+      checkDesBox.addEventListener('onchange', () => {
         this.dispatchEvent(new CustomEvent('addProbe', {}));
       });
       this._abilityConfig?.appendChild(checkDesBox);
@@ -181,7 +181,6 @@ export class SpProbesConfig extends BaseElement {
       { value: 'app', isSelect: true },
       { value: 'ark', isSelect: true },
       { value: 'binder', isSelect: true },
-      { value: 'commonlibrary', isSelect: false },
       { value: 'daudio', isSelect: false },
       { value: 'dcamera', isSelect: false },
       { value: 'devicemanager', isSelect: false },
@@ -237,12 +236,12 @@ export class SpProbesConfig extends BaseElement {
       litCheckBox.setAttribute('name', 'userEvents');
       litCheckBox.value = hitraceConfig.value;
       litCheckBox.checked = hitraceConfig.isSelect;
-      litCheckBox.addEventListener('change', (ev: any) => {
+      litCheckBox.addEventListener('change', (ev: CustomEventInit) => {
         let detail = ev.detail;
         if (this.hitrace?.checked == false) {
-          this.hitrace.checked = detail.checked;
+          this.hitrace.checked = detail!.checked;
         }
-        if (detail.checked == false && this.hitrace?.checked == true) {
+        if (detail!.checked == false && this.hitrace?.checked == true) {
           let hasChecked = false;
           const nodes = parent?.querySelectorAll(`lit-check-box[name=userEvents]`);
           nodes.forEach((vv) => {
@@ -504,10 +503,10 @@ export class SpProbesConfig extends BaseElement {
   public connectedCallback() {
     let parent = this.shadowRoot?.querySelector('.user-events') as Element;
     const siblingNode = parent?.querySelectorAll(`lit-check-box[name=userEvents]`);
-    this.hitrace!.addEventListener('onchange', (ev: any) => {
+    this.hitrace!.addEventListener('onchange', (ev: CustomEventInit) => {
       let detail = ev.detail;
       siblingNode.forEach((node) => {
-        node.checked = detail.checked;
+        node.checked = detail!.checked;
       });
       this.dispatchEvent(new CustomEvent('addProbe', {}));
     });
diff --git a/ide/src/trace/component/setting/SpRecordPerf.ts b/ide/src/trace/component/setting/SpRecordPerf.ts
index f0b0b9da..ae0b9893 100644
--- a/ide/src/trace/component/setting/SpRecordPerf.ts
+++ b/ide/src/trace/component/setting/SpRecordPerf.ts
@@ -17,12 +17,12 @@ import { BaseElement, element } from '../../../base-ui/BaseElement.js';
 import { LitSelectV } from '../../../base-ui/select/LitSelectV.js';
 import { LitSelect } from '../../../base-ui/select/LitSelect.js';
 import { LitSlider } from '../../../base-ui/slider/LitSlider.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import '../../../base-ui/select/LitSelectV.js';
 import '../../../base-ui/select/LitSelect.js';
 
 import '../../../base-ui/switch/lit-switch.js';
-import { info, log } from '../../../log/Log.js';
+import { info } from '../../../log/Log.js';
 import { HdcDeviceManager } from '../../../hdc/HdcDeviceManager.js';
 import { SpRecordTrace } from '../SpRecordTrace.js';
 import { SpApplication } from '../../SpApplication.js';
@@ -272,9 +272,9 @@ export class SpRecordPerf extends BaseElement {
             recordPerfSwitch.checked = false;
           }
           if (config.title == 'Start Hiperf Sampling') {
-            recordPerfSwitch.addEventListener('change', (event: any) => {
+            recordPerfSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startSamp = true;
                 this.unDisable();
                 this.dispatchEvent(new CustomEvent('addProbe', {}));
@@ -294,11 +294,10 @@ export class SpRecordPerf extends BaseElement {
       recordPerfConfigList!.appendChild(recordPerfDiv);
     });
     let sp = document.querySelector('sp-application') as SpApplication;
-    let recordPerfSearch = sp?.shadowRoot?.querySelector('#lit-search') as LitSearch;
+    let recordPerfSearch = sp?.shadowRoot?.querySelector('#lit-record-search') as LitSearch;
     this.processSelect = this.shadowRoot?.querySelector("lit-select-v[title='Process']");
     this.recordProcessInput = this.processSelect?.shadowRoot?.querySelector('input');
     let querySelector = this.processSelect!.shadowRoot?.querySelector('input') as HTMLInputElement;
-    let recordPerfProcessData: Array = [];
     querySelector.addEventListener('mousedown', (ev) => {
       if (SpRecordTrace.serialNumber == '') {
         this.processSelect!.dataSource([], 'ALL-Process');
@@ -312,58 +311,19 @@ export class SpRecordPerf extends BaseElement {
           sp.search = false;
           recordPerfSearch.clear();
         }
-        if (SpRecordTrace.isVscode) {
-          let cmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]);
-          Cmd.execHdcCmd(cmd, (res: string) => {
-            recordPerfProcessData = [];
-            let recordPerfValuesVs: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-            for (let lineVal of recordPerfValuesVs) {
-              if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                continue;
-              }
-              let recordPerfProcessVs: string[] = lineVal.trim().split(' ');
-              if (recordPerfProcessVs.length == 2) {
-                let processId = recordPerfProcessVs[0];
-                let processName = recordPerfProcessVs[1];
-                recordPerfProcessData.push(processName + '(' + processId + ')');
-              }
-            }
-            if (recordPerfProcessData.length > 0 && this.startSamp) {
+        Cmd.getProcess().then(
+          (processList) => {
+            if (processList.length > 0 && this.startSamp) {
               this.recordProcessInput!.setAttribute('readonly', 'readonly');
             }
-            this.processSelect?.dataSource(recordPerfProcessData, 'ALL-Process');
-          });
-        } else {
-          HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => {
-            if (conn) {
-              HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((res) => {
-                recordPerfProcessData = [];
-                if (res) {
-                  let recordPerfValues: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-                  for (let lineVal of recordPerfValues) {
-                    if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                      continue;
-                    }
-                    let recordPerfProcess: string[] = lineVal.trim().split(' ');
-                    if (recordPerfProcess.length == 2) {
-                      let processId = recordPerfProcess[0];
-                      let processName = recordPerfProcess[1];
-                      recordPerfProcessData.push(processName + '(' + processId + ')');
-                    }
-                  }
-                }
-                if (recordPerfProcessData.length > 0 && this.startSamp) {
-                  this.recordProcessInput!.setAttribute('readonly', 'readonly');
-                }
-                this.processSelect?.dataSource(recordPerfProcessData, 'ALL-Process');
-              });
-            } else {
-              sp.search = true;
-              recordPerfSearch.clear();
-              recordPerfSearch.setPercent('please kill other hdc-server !', -2);
-            }
-          });
-        }
+            this.processSelect?.dataSource(processList, 'ALL-Process');
+          },
+          (rejected) => {
+            sp.search = true;
+            recordPerfSearch.clear();
+            recordPerfSearch.setPercent('please kill other hdc-server !', -2);
+          }
+        );
       }
     });
 
diff --git a/ide/src/trace/component/setting/SpRecordTemplate.ts b/ide/src/trace/component/setting/SpRecordTemplate.ts
index e4c8e302..8a42e304 100644
--- a/ide/src/trace/component/setting/SpRecordTemplate.ts
+++ b/ide/src/trace/component/setting/SpRecordTemplate.ts
@@ -14,7 +14,7 @@
  */
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import { ProfilerPluginConfig, TracePluginConfig } from './bean/ProfilerServiceTypes.js';
 import { SpRecordTrace } from '../SpRecordTrace.js';
 
@@ -82,22 +82,22 @@ export class SpRecordTemplate extends BaseElement {
   initElements(): void {
     this.frameTimeline = this.shadowRoot?.querySelector('#frame_timeline');
     this.schedulingAnalysis = this.shadowRoot?.querySelector('#scheduling_analysis');
-    this.frameTimeline!.addEventListener('change', (event: any) => {
+    this.frameTimeline!.addEventListener('change', (event: CustomEventInit) => {
       let detail = event.detail;
-      if (detail.checked) {
+      if (detail!.checked) {
         this.dispatchEvent(new CustomEvent('addProbe', {}));
       }
     });
-    this.schedulingAnalysis!.addEventListener('change', (event: any) => {
+    this.schedulingAnalysis!.addEventListener('change', (event: CustomEventInit) => {
       let detail = event.detail;
-      if (detail.checked) {
+      if (detail!.checked) {
         this.dispatchEvent(new CustomEvent('addProbe', {}));
       }
     });
   }
 
-  getTemplateConfig(): Array> {
-    let config: Array = [];
+  getTemplateConfig(): Array> {
+    let config: Array> = [];
     let traceEventSet = new Array();
     let hitraceCategories = new Array();
     let useFtracePlugin: boolean = false;
diff --git a/ide/src/trace/component/setting/SpSdkConfig.ts b/ide/src/trace/component/setting/SpSdkConfig.ts
index 2a1b0c10..9e47432a 100644
--- a/ide/src/trace/component/setting/SpSdkConfig.ts
+++ b/ide/src/trace/component/setting/SpSdkConfig.ts
@@ -18,10 +18,9 @@ import '../../../base-ui/select/LitSelectV.js';
 import '../../../base-ui/select/LitSelect.js';
 
 import '../../../base-ui/switch/lit-switch.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import { LitSelectV } from '../../../base-ui/select/LitSelectV.js';
 import { LitAllocationSelect } from '../../../base-ui/select/LitAllocationSelect.js';
-import { SpRecordTrace } from '../SpRecordTrace.js';
 
 @element('sp-sdk-config')
 export class SpSdkConfig extends BaseElement {
@@ -114,15 +113,16 @@ export class SpSdkConfig extends BaseElement {
     return this.sampleInterval;
   }
 
-  getGpuConfig(): any {
+  getGpuConfig(): {} {
     let configVal = this.shadowRoot?.querySelectorAll('.config');
-    let gpuConfig: any = {};
+    let gpuConfig = {};
     for (let i = 0; i < configVal!.length; i++) {
       let configName = configVal![i].getAttribute('configName');
       let type = configVal![i].getAttribute('type');
       if (type == 'enum') {
         let enumValue = configVal![i].getAttribute('value');
         if (enumValue != undefined && enumValue != 'undefined') {
+          // @ts-ignore
           gpuConfig[configName!] = enumValue;
         }
       } else if (type == 'number' || type == 'integer' || type == 'num') {
@@ -130,6 +130,7 @@ export class SpSdkConfig extends BaseElement {
         gpuConfig[configName!] = Number(configVal![i].value);
       } else if (type == 'boolean') {
         let attribute = configVal![i].getAttribute('value');
+        // @ts-ignore
         gpuConfig[configName!] = attribute == 'true';
       } else {
         // @ts-ignore
@@ -172,9 +173,9 @@ export class SpSdkConfig extends BaseElement {
     } catch (e) {}
     this.customConfig = this.shadowRoot?.querySelector('.configList');
     let switchButton = this.shadowRoot?.querySelector('.config_switch') as LitSwitch;
-    switchButton.addEventListener('change', (event: any) => {
+    switchButton.addEventListener('change', (event: CustomEventInit) => {
       let detail = event.detail;
-      if (detail.checked) {
+      if (detail!.checked) {
         this.startSamp = true;
         this.isAbleShowConfig(false);
       } else {
@@ -292,12 +293,12 @@ export class SpSdkConfig extends BaseElement {
         select!.setAttribute('value', this.sdkConfigList.configuration[key].default);
         select!.dataSource(this.sdkConfigList.configuration[key].enum, '');
         this.list.push(select!);
-        select!.addEventListener('click', (event: any) => {
+        select!.addEventListener('click', () => {
           select!.setAttribute('value', select!.value);
         });
       }
     }
-    sdkConfigSwitch.addEventListener('change', (event: any) => {
+    sdkConfigSwitch.addEventListener('change', () => {
       if (sdkConfigSwitch.hasAttribute('checked')) {
         sdkConfigSwitch.setAttribute('value', 'true');
       } else {
diff --git a/ide/src/trace/component/setting/SpTraceCommand.ts b/ide/src/trace/component/setting/SpTraceCommand.ts
index 257e41da..bc00bb64 100644
--- a/ide/src/trace/component/setting/SpTraceCommand.ts
+++ b/ide/src/trace/component/setting/SpTraceCommand.ts
@@ -44,7 +44,7 @@ export class SpTraceCommand extends BaseElement {
     this.copyEl?.removeEventListener('click', this.codeCopyEvent);
   }
 
-  codeCopyEvent = (event: any) => {
+  codeCopyEvent = () => {
     this.codeHl?.select();
     document.execCommand('copy');
     let allPlugin: Array = [];
@@ -60,7 +60,7 @@ export class SpTraceCommand extends BaseElement {
     });
   };
 
-  textSelectEvent = (event: any) => {
+  textSelectEvent = () => {
     this.copyEl!.style.backgroundColor = '#FFFFFF';
   };
 
diff --git a/ide/src/trace/component/setting/SpVmTracker.ts b/ide/src/trace/component/setting/SpVmTracker.ts
index ef099a96..d2a8c3de 100644
--- a/ide/src/trace/component/setting/SpVmTracker.ts
+++ b/ide/src/trace/component/setting/SpVmTracker.ts
@@ -14,7 +14,7 @@
  */
 
 import { BaseElement, element } from '../../../base-ui/BaseElement.js';
-import LitSwitch from '../../../base-ui/switch/lit-switch.js';
+import LitSwitch, { LitSwitchChangeEvent } from '../../../base-ui/switch/lit-switch.js';
 import '../../../base-ui/select/LitAllocationSelect.js';
 
 import '../../../base-ui/switch/lit-switch.js';
@@ -93,9 +93,9 @@ export class SpVmTracker extends BaseElement {
             vmTrackerSwitch.checked = false;
           }
           if (config.title == 'Start VM Tracker Record') {
-            vmTrackerSwitch.addEventListener('change', (event: any) => {
+            vmTrackerSwitch.addEventListener('change', (event: CustomEventInit) => {
               let detail = event.detail;
-              if (detail.checked) {
+              if (detail!.checked) {
                 this.startSamp = true;
                 this.unDisable();
               } else {
@@ -116,7 +116,6 @@ export class SpVmTracker extends BaseElement {
     );
     let vmTrackerMul = this.vmTrackerProcessInput?.shadowRoot?.querySelector('.multipleSelect') as HTMLDivElement;
     this.vmTrackerSelectProcess = this.vmTrackerProcessInput!.shadowRoot?.querySelector('input') as HTMLInputElement;
-    let processData: Array = [];
     vmTrackerMul!.addEventListener('mousedown', (ev) => {
       if (SpRecordTrace.serialNumber == '') {
         this.vmTrackerProcessInput!.processData = [];
@@ -128,50 +127,10 @@ export class SpVmTracker extends BaseElement {
         this.vmTrackerProcessInput!.processData = [];
         this.vmTrackerProcessInput!.initData();
       } else {
-        if (SpRecordTrace.isVscode) {
-          let vmTrackerCmd = Cmd.formatString(CmdConstant.CMD_GET_PROCESS_DEVICES, [SpRecordTrace.serialNumber]);
-          Cmd.execHdcCmd(vmTrackerCmd, (res: string) => {
-            processData = [];
-            let lineArray: string[] = res.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-            for (let lineVal of lineArray) {
-              if (lineVal.indexOf('__progname') != -1 || lineVal.indexOf('PID CMD') != -1) {
-                continue;
-              }
-              let processArray: string[] = lineVal.trim().split(' ');
-              if (processArray.length == 2) {
-                let processId = processArray[0];
-                let processName = processArray[1];
-                processData.push(processName + '(' + processId + ')');
-              }
-            }
-            this.vmTrackerProcessInput!.processData = processData;
-            this.vmTrackerProcessInput!.initData();
-          });
-        } else {
-          HdcDeviceManager.connect(SpRecordTrace.serialNumber).then((conn) => {
-            if (conn) {
-              HdcDeviceManager.shellResultAsString(CmdConstant.CMD_GET_PROCESS, false).then((result) => {
-                processData = [];
-                if (result) {
-                  let lineValues: string[] = result.replace(/\r\n/g, '\r').replace(/\n/g, '\r').split(/\r/);
-                  for (let lineItem of lineValues) {
-                    if (lineItem.indexOf('__progname') != -1 || lineItem.indexOf('PID CMD') != -1) {
-                      continue;
-                    }
-                    let process: string[] = lineItem.trim().split(' ');
-                    if (process.length == 2) {
-                      let processId = process[0];
-                      let processName = process[1];
-                      processData.push(processName + '(' + processId + ')');
-                    }
-                  }
-                }
-                this.vmTrackerProcessInput!.processData = processData;
-                this.vmTrackerProcessInput!.initData();
-              });
-            }
-          });
-        }
+        Cmd.getProcess().then((processList) => {
+          this.vmTrackerProcessInput!.processData = processList;
+          this.vmTrackerProcessInput!.initData();
+        });
       }
     });
     this.disable();
diff --git a/ide/src/trace/component/setting/utils/PluginConvertUtils.ts b/ide/src/trace/component/setting/utils/PluginConvertUtils.ts
index 4ec9edc8..d0020281 100644
--- a/ide/src/trace/component/setting/utils/PluginConvertUtils.ts
+++ b/ide/src/trace/component/setting/utils/PluginConvertUtils.ts
@@ -135,7 +135,7 @@ export class PluginConvertUtils {
 
   private static handleArray(
     key: string,
-    arr: Array,
+    arr: Array,
     indentation: number,
     needColon: boolean,
     spacesNumber: number
@@ -223,12 +223,12 @@ export class PluginConvertUtils {
     return humpString.replace(/[A-Z]/g, (value) => '_' + value.toLowerCase());
   }
 
-  private static getMontageStrings(
+  private static getMontageStrings(
     prefixText: string,
     spacesNumber: number,
     indentation: number,
     key: string,
-    value: any
+    value: T
   ): string {
     return (
       prefixText +
diff --git a/ide/src/trace/component/trace/TimerShaftElement.ts b/ide/src/trace/component/trace/TimerShaftElement.ts
index 06cf4f60..44b52d0a 100644
--- a/ide/src/trace/component/trace/TimerShaftElement.ts
+++ b/ide/src/trace/component/trace/TimerShaftElement.ts
@@ -17,17 +17,10 @@ import { BaseElement, element } from '../../../base-ui/BaseElement.js';
 import { TimeRuler } from './timer-shaft/TimeRuler.js';
 import { Rect } from './timer-shaft/Rect.js';
 import { RangeRuler, TimeRange } from './timer-shaft/RangeRuler.js';
-import { SlicesTime, SportRuler } from './timer-shaft/SportRuler.js';
+import { SportRuler } from './timer-shaft/SportRuler.js';
 import { procedurePool } from '../../database/Procedure.js';
 import { Flag } from './timer-shaft/Flag.js';
 import { info } from '../../../log/Log.js';
-import { tabConfig } from './base/TraceSheetConfig.js';
-import { TraceSheet } from './base/TraceSheet.js';
-import { LitTabs } from '../../../base-ui/tabs/lit-tabs.js';
-import { LitTabpane } from '../../../base-ui/tabs/lit-tabpane.js';
-import { TabPaneCurrent } from './sheet/TabPaneCurrent.js';
-import { SelectionParam } from '../../bean/BoxSelection.js';
-import { SpSystemTrace } from '../SpSystemTrace.js';
 
 //随机生成十六位进制颜色
 export function randomRgbColor() {
@@ -59,6 +52,27 @@ export function ns2s(ns: number): string {
   return result;
 }
 
+export function ns2UnitS(ns: number, scale: number): string {
+  let one_second = 1_000_000_000; // 1 second
+  let result;
+  if (scale >= 10_000_000_000) {
+    result = (ns / one_second).toFixed(0) + ' s';
+  } else if (scale >= 1_000_000_000) {
+    result = (ns / one_second).toFixed(1) + ' s';
+  } else if (scale >= 100_000_000) {
+    result = (ns / one_second).toFixed(2) + ' s';
+  } else if (scale >= 10_000_000) {
+    result = (ns / one_second).toFixed(3) + ' s';
+  } else if (scale >= 1_000_000) {
+    result = (ns / one_second).toFixed(4) + ' s';
+  } else if (scale >= 100_000) {
+    result = (ns / one_second).toFixed(5) + ' s';
+  } else {
+    result = (ns / one_second).toFixed(6) + ' s';
+  }
+  return result;
+}
+
 export function ns2x(ns: number, startNS: number, endNS: number, duration: number, rect: Rect) {
   if (endNS == 0) {
     endNS = duration;
@@ -86,7 +100,6 @@ export class TimerShaftElement extends BaseElement {
   public loadComplete: boolean = false;
   public collecBtn: HTMLElement | null | undefined;
   rangeChangeHandler: ((timeRange: TimeRange) => void) | undefined = undefined;
-  rangeClickHandler: ((sliceTime: SlicesTime | undefined | null) => void) | undefined = undefined;
   flagChangeHandler: ((hoverFlag: Flag | undefined | null, selectFlag: Flag | undefined | null) => void) | undefined =
     undefined;
   flagClickHandler: ((flag: Flag | undefined | null) => void) | undefined = undefined;
@@ -108,12 +121,7 @@ export class TimerShaftElement extends BaseElement {
   private _totalNS: number = 10_000_000_000;
   private _startNS: number = 0;
   private _endNS: number = 10_000_000_000;
-  private traceSheetEL: TraceSheet | undefined | null;
-  private sliceTime: SlicesTime | undefined | null;
-  public selectionList: Array = [];
-  public selectionMap: Map = new Map();
-
-
+  
   get sportRuler(): SportRuler | undefined {
     return this._sportRuler;
   }
@@ -166,9 +174,6 @@ export class TimerShaftElement extends BaseElement {
       this.rangeRuler.markBObj.frame.x = this.rangeRuler.frame.width;
       this.rangeRuler.cpuUsage = [];
       this.sportRuler!.flagList.length = 0;
-      this.sportRuler!.slicesTimeList.length = 0;
-      this.selectionList.length = 0;
-      this.selectionMap.clear();
       this.sportRuler!.isRangeSelect = false;
       this.setSlicesMark();
     }
@@ -187,6 +192,10 @@ export class TimerShaftElement extends BaseElement {
     window.subscribe(window.SmartEvent.UI.TimeRange, (b) => this.setRangeNS(b.startNS, b.endNS));
   }
 
+  getRangeRuler() {
+    return this.rangeRuler;
+  }
+
   connectedCallback() {
     if (this.canvas) {
       if (this.isOffScreen) {
@@ -198,7 +207,8 @@ export class TimerShaftElement extends BaseElement {
       }
     }
     if (this.timeTotalEL) this.timeTotalEL.textContent = ns2s(this._totalNS);
-    if (this.timeOffsetEL) this.timeOffsetEL.textContent = ns2s(this._startNS);
+    if (this.timeOffsetEL && this.rangeRuler)
+      this.timeOffsetEL.textContent = ns2UnitS(this._startNS,this.rangeRuler.getScale());
     const width = this.canvas?.clientWidth || 0;
     const height = this.canvas?.clientHeight || 0;
     if (!this.timeRuler) {
@@ -213,10 +223,8 @@ export class TimerShaftElement extends BaseElement {
         },
         (flag) => {
           this.flagClickHandler?.(flag);
-        },
-        (slicetime) => {
-          this.rangeClickHandler?.(slicetime);
-        });
+        }
+      );
     }
     if (!this.rangeRuler) {
       this.rangeRuler = new RangeRuler(
@@ -242,8 +250,8 @@ export class TimerShaftElement extends BaseElement {
           if (this._sportRuler) {
             this._sportRuler.range = a;
           }
-          if (this.timeOffsetEL) {
-            this.timeOffsetEL.textContent = ns2s(a.startNS);
+          if (this.timeOffsetEL && this.rangeRuler) {
+            this.timeOffsetEL.textContent = ns2UnitS(a.startNS,this.rangeRuler.getScale());
           }
           if (this.loadComplete) {
             this.rangeChangeHandler?.(a);
@@ -265,10 +273,6 @@ export class TimerShaftElement extends BaseElement {
     return this.rangeRuler?.getRange();
   }
 
-  getRangeRuler() {
-    return this.rangeRuler;
-  }
-
   updateWidth(width: number) {
     this.dpr = window.devicePixelRatio || 1;
     this.canvas!.width = width - (this.totalEL?.clientWidth || 0);
@@ -300,20 +304,11 @@ export class TimerShaftElement extends BaseElement {
   };
 
   documentOnMouseMove = (ev: MouseEvent) => {
-    let x = ev.offsetX - (this.canvas?.offsetLeft || 0);  // 鼠标的x轴坐标  
-    let y = ev.offsetY; // 鼠标的y轴坐标                  
-    let findSlicestime = this.sportRuler?.findSlicesTime(x, y); // 查找帽子    
-    if (!findSlicestime) { // 如果在该位置没有找到一个“帽子”,则可以显示一个旗子。
-      this.sportRuler?.showHoverFlag();
-      this.rangeRuler?.mouseMove(ev);
-      if (this.sportRuler?.edgeDetection(ev)) {
-        this.sportRuler?.mouseMove(ev);
-      } else {
-        this.sportRuler?.mouseOut(ev);
-      }
+    this.rangeRuler?.mouseMove(ev);
+    if (this.sportRuler?.edgeDetection(ev)) {
+      this.sportRuler?.mouseMove(ev);
     } else {
-      this.sportRuler?.clearHoverFlag();
-      this.sportRuler?.modifyFlagList(null);//重新绘制旗子,清除hover flag   
+      this.sportRuler?.mouseOut(ev);
     }
   };
 
@@ -382,10 +377,6 @@ export class TimerShaftElement extends BaseElement {
     this._sportRuler?.modifyFlagList(flag);
   }
 
-  modifySlicesList(slicestime: SlicesTime | null | undefined) {
-    this._sportRuler?.modifySicesTimeList(slicestime);
-  }
-
   cancelPressFrame() {
     this.rangeRuler?.cancelPressFrame();
   }
@@ -406,21 +397,8 @@ export class TimerShaftElement extends BaseElement {
     this._sportRuler?.removeTriangle(type);
   }
 
-  setSlicesMark(startTime: null | number = null, endTime: null | number = null, shiftKey: null | boolean = false): SlicesTime | null | undefined {
-    let sliceTime = this._sportRuler?.setSlicesMark(startTime, endTime, shiftKey);
-    if (sliceTime && sliceTime != undefined) {
-      this.traceSheetEL?.displayCurrent(sliceTime); // 给当前pane准备数据
-
-      // 取最新创建的那个selection对象
-      let selection = this.selectionList[this.selectionList.length - 1];
-      if (selection) {
-        selection.isCurrentPane = true;  // 设置当前面板为可以显示的状态
-        //把刚刚创建的slicetime和selection对象关联起来,以便后面再次选中“跑道”的时候显示对应的面板。
-        this.selectionMap.set(sliceTime.id, selection);
-        this.traceSheetEL?.rangeSelect(selection);  // 显示选中区域对应的面板                 
-      }
-    }
-    return sliceTime;
+  setSlicesMark(startTime: null | number = null, endTime: null | number = null) {
+    this._sportRuler?.setSlicesMark(startTime, endTime);
   }
 
 
@@ -499,7 +477,7 @@ export class TimerShaftElement extends BaseElement {
                     10
                     0
                     
- +
diff --git a/ide/src/trace/component/trace/base/ColorUtils.ts b/ide/src/trace/component/trace/base/ColorUtils.ts index f838e36e..0eb82b51 100644 --- a/ide/src/trace/component/trace/base/ColorUtils.ts +++ b/ide/src/trace/component/trace/base/ColorUtils.ts @@ -20,19 +20,19 @@ export class ColorUtils { public static FUNC_COLOR_A: Array = [ '#40b3e7', - '#23b0e7', + '#606e75', '#8d9171', - '#FF0066', + '#8f8f8f', '#7a9160', '#9fafc4', '#8a8a8b', - '#e05b52', - '#9bb87a', - '#ebc247', - '#c2cc66', + '#9e8e00', + '#696e35', + '#5c4d21', + '#18a8a1', '#a16a40', '#a94eb9', - '#aa4fba', + '#886EB4', ]; public static FUNC_COLOR_B: Array = [ '#9785D3', diff --git a/ide/src/trace/component/trace/base/RangeSelect.ts b/ide/src/trace/component/trace/base/RangeSelect.ts index 4ab5da25..fb9c98d8 100644 --- a/ide/src/trace/component/trace/base/RangeSelect.ts +++ b/ide/src/trace/component/trace/base/RangeSelect.ts @@ -232,6 +232,10 @@ export class RangeSelect { rt = new Rect(xMin, Math.min(this.startY2, this.endY2), xMax - xMin, Math.abs(this.startY2 - this.endY2)); } else { bound = it.getBoundingClientRect(); + if (spacerRect.height > 0 && bound.y + bound.height < spacerRect.y + spacerRect.height) { + it.rangeSelect = false; + return false; + } itRect = Rect.getIntersect( bound, new Rect(rowsRect.x, rowsRect.y + spacerRect.height, rowsRect.width, rowsRect.height - spacerRect.height) diff --git a/ide/src/trace/component/trace/base/TraceRow.ts b/ide/src/trace/component/trace/base/TraceRow.ts index 223600a8..08ba12f6 100644 --- a/ide/src/trace/component/trace/base/TraceRow.ts +++ b/ide/src/trace/component/trace/base/TraceRow.ts @@ -627,11 +627,9 @@ export class TraceRow extends HTMLElement { info('checkBoxEL target not checked'); this.rangeSelect = false; this.checkType = '0'; - this.draw(); } else { this.rangeSelect = true; this.checkType = '2'; - this.draw(); } this.setCheckBox(ev.target.checked); }; @@ -683,21 +681,23 @@ export class TraceRow extends HTMLElement { }); }; this.collectEL!.onclick = (e) => { - this.collect = !this.collect; - if (this.collect) { - this.describeEl!.draggable = false; - } else { - this.describeEl!.draggable = false; + if (this.isComplete) { + this.collect = !this.collect; + if (this.collect) { + this.describeEl!.draggable = false; + } else { + this.describeEl!.draggable = false; + } + document.dispatchEvent( + new CustomEvent('collect', { + detail: { + type: e.type, + row: this, + }, + }) + ); + this.favoriteChangeHandler?.(this); } - document.dispatchEvent( - new CustomEvent('collect', { - detail: { - type: e.type, - row: this, - }, - }) - ); - this.favoriteChangeHandler?.(this); }; if (!this.args['skeleton']) { this.initCanvas(this.canvas); @@ -788,12 +788,10 @@ export class TraceRow extends HTMLElement { checkList?.forEach((rowItem) => { rowItem.checkType = '2'; rowItem.rangeSelect = true; - rowItem.draw(); }); checkList2?.forEach((it) => { it.checkType = '2'; it.rangeSelect = true; - it.draw(); }); } else { this.parentRowEl?.setAttribute('check-type', '1'); @@ -804,22 +802,18 @@ export class TraceRow extends HTMLElement { checkList?.forEach((it) => { it.checkType = '2'; it.rangeSelect = true; - it.draw(); }); checkList2?.forEach((it) => { it.checkType = '2'; it.rangeSelect = true; - it.draw(); }); unselectedList?.forEach((item) => { item.checkType = '0'; item.rangeSelect = false; - item.draw(); }); unselectedList2?.forEach((it) => { it.checkType = '0'; it.rangeSelect = false; - it.draw(); }); } @@ -832,12 +826,10 @@ export class TraceRow extends HTMLElement { unselectedList?.forEach((it) => { it.checkType = '0'; it.rangeSelect = false; - it.draw(); }); unselectedList2?.forEach((it) => { it.checkType = '0'; it.rangeSelect = false; - it.draw(); }); } let traceRowList: Array> = []; @@ -936,6 +928,9 @@ export class TraceRow extends HTMLElement { const clipRect = new Path2D(); clipRect.rect(0, 0, this.frame.width, this.frame.height); ctx.clip(clipRect); + if(this.collect){ + ctx.clearRect(this.frame.x, this.frame.y, this.frame.width, this.frame.height); + } } canvasRestore(ctx: CanvasRenderingContext2D) { diff --git a/ide/src/trace/component/trace/base/TraceRowConfig.ts b/ide/src/trace/component/trace/base/TraceRowConfig.ts index 404c637c..892d9240 100644 --- a/ide/src/trace/component/trace/base/TraceRowConfig.ts +++ b/ide/src/trace/component/trace/base/TraceRowConfig.ts @@ -49,6 +49,7 @@ export class TraceRowConfig extends BaseElement { this.selectTypeList = []; this.sceneTable!.innerHTML = ''; this.chartTable!.innerHTML = ''; + this.inputElement!.value = ''; this.spSystemTrace = this.parentElement!.querySelector('sp-system-trace'); this.traceRowList = this.spSystemTrace!.shadowRoot?.querySelector('div[class=rows-pane]')!.querySelectorAll>( @@ -70,7 +71,7 @@ export class TraceRowConfig extends BaseElement { }); } - initConfigSceneTable(item: any) { + initConfigSceneTable(item: string) { let div = document.createElement('div'); div.className = 'scene-option-div'; div.textContent = item; @@ -112,29 +113,36 @@ export class TraceRowConfig extends BaseElement { optionCheckBox.title = templateType; optionCheckBox.setAttribute('search_text', row.name); optionCheckBox.addEventListener('change', (e) => { - TraceRowConfig.allTraceRowList.forEach((chartRow) => { - let upParentRow = getUpParentRow(chartRow); - if (upParentRow == row) { - if (optionCheckBox.checked) { - chartRow.removeAttribute('row-hidden'); - chartRow.setAttribute('scene', ''); - } else { - chartRow.removeAttribute('scene'); - chartRow.setAttribute('row-hidden', ''); + if (row.folder) { + TraceRowConfig.allTraceRowList.forEach((chartRow): void => { + let upParentRow = chartRow; + while (upParentRow.hasParentRowEl) { + if (upParentRow.parentRowEl) { + upParentRow = upParentRow.parentRowEl; + } else { + break; + } } - } - }); + if (upParentRow == row) { + if (optionCheckBox.checked) { + chartRow.removeAttribute('row-hidden'); + chartRow.setAttribute('scene', ''); + } else { + chartRow.removeAttribute('scene'); + chartRow.setAttribute('row-hidden', ''); + } + } + }); + } + if (optionCheckBox.checked) { + row.removeAttribute('row-hidden'); + row.setAttribute('scene', ''); + } else { + row.removeAttribute('scene'); + row.setAttribute('row-hidden', ''); + } this.refreshSystemPanel(); }); - - let getUpParentRow = (currentTraceRow: TraceRow) => { - let newTraceRow = currentTraceRow; - if (currentTraceRow.hasParentRowEl) { - newTraceRow = currentTraceRow.parentRowEl!; - getUpParentRow(newTraceRow); - } - return newTraceRow; - }; this.chartTable!.append(...[div, optionCheckBox]); } diff --git a/ide/src/trace/component/trace/base/TraceSheet.ts b/ide/src/trace/component/trace/base/TraceSheet.ts index 8ee02db5..e06a038c 100644 --- a/ide/src/trace/component/trace/base/TraceSheet.ts +++ b/ide/src/trace/component/trace/base/TraceSheet.ts @@ -41,8 +41,7 @@ import { HeapSnapshotStruct } from '../../../database/ui-worker/ProcedureWorkerH import { TabPaneComparison } from '../sheet/snapshot/TabPaneComparison.js'; import { TabPaneSummary } from '../sheet/snapshot/TabPaneSummary.js'; import { TabPaneNMStatisticAnalysis } from '../sheet/native-memory/TabPaneNMStatisticAnalysis.js'; -import { TabPaneCurrent } from '../sheet/TabPaneCurrent.js'; -import { SlicesTime } from '../timer-shaft/SportRuler.js'; + @element('trace-sheet') export class TraceSheet extends BaseElement { private litTabs: LitTabs | undefined | null; @@ -270,17 +269,24 @@ export class TraceSheet extends BaseElement { } } if (fileList.length > 0) { + importFileBt!.disabled = true; window.publish(window.SmartEvent.UI.Loading, true); threadPool.submit( 'upload-so', '', fileList, - (res: any) => { - window.publish(window.SmartEvent.UI.UploadSOFile, {}); + (res: string) => { + importFileBt!.disabled = false; + if (res === 'ok') { + window.publish(window.SmartEvent.UI.UploadSOFile, {}); + } else { + window.publish(window.SmartEvent.UI.Error, 'parse so file failed!'); + } }, 'upload-so' ); } + fileList.length = 0; } importFileBt!.files = null; importFileBt!.value = ''; @@ -340,8 +346,7 @@ export class TraceSheet extends BaseElement { `; } - displayCurrent = (data: SlicesTime) => - this.displayTab('tabpane-current').setCurrentSlicesTime(data); + displayThreadData = ( data: ThreadStruct, scrollCallback: ((e: ThreadStruct) => void) | undefined, @@ -520,7 +525,7 @@ export class TraceSheet extends BaseElement { clearMemory() { let allTabs = Array.from(this.shadowRoot?.querySelectorAll('#tabs lit-tabpane').values() || []); - allTabs.forEach(tab => { + allTabs.forEach( tab => { if (tab) { let tables = Array.from( (tab.firstChild as BaseElement).shadowRoot?.querySelectorAll('lit-table') || [] diff --git a/ide/src/trace/component/trace/base/TraceSheetConfig.ts b/ide/src/trace/component/trace/base/TraceSheetConfig.ts index 22eee39f..6a2f819a 100644 --- a/ide/src/trace/component/trace/base/TraceSheetConfig.ts +++ b/ide/src/trace/component/trace/base/TraceSheetConfig.ts @@ -72,14 +72,8 @@ import { TabPanePerfAnalysis } from '../sheet/hiperf/TabPanePerfAnalysis.js'; import { TabPaneNMStatisticAnalysis } from '../sheet/native-memory/TabPaneNMStatisticAnalysis.js'; import { TabPaneFilesystemStatisticsAnalysis } from '../sheet/file-system/TabPaneFilesystemStatisticsAnalysis.js'; import { TabPaneIOTierStatisticsAnalysis } from '../sheet/file-system/TabPaneIOTierStatisticsAnalysis.js'; -import { TabPaneCurrent } from '../sheet/TabPaneCurrent.js'; import { TabPaneVirtualMemoryStatisticsAnalysis } from '../sheet/file-system/TabPaneVirtualMemoryStatisticsAnalysis.js'; export let tabConfig: any = { - 'tabpane-current': { - title: 'Current Selection', - type: TabPaneCurrent, - require: (param: SelectionParam) => param.isCurrentPane, - }, //current selection 'current-selection': { title: 'Current Selection', type: TabPaneCurrentSelection, diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrent.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrent.ts deleted file mode 100644 index 82a42797..00000000 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrent.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { BaseElement, element } from '../../../../base-ui/BaseElement.js'; -import { SlicesTime } from '../timer-shaft/SportRuler'; - -@element('tabpane-current') -export class TabPaneCurrent extends BaseElement { - private slicestime: SlicesTime | null = null; - initElements(): void { - this.shadowRoot?.querySelector('#color-input')?.addEventListener('change', (event: any) => { - if (this.slicestime) { - this.slicestime.color = event?.target.value; - document.dispatchEvent(new CustomEvent('slices-change', { detail: this.slicestime })); - } - }); - this.shadowRoot?.querySelector('#text-input')?.addEventListener('keyup', (event: any) => { - event.stopPropagation(); - if (event.keyCode == '13') { - if (this.slicestime) { - window.publish(window.SmartEvent.UI.KeyboardEnable, { - enable: true, - }); - this.slicestime.text = event?.target.value; - document.dispatchEvent( - new CustomEvent('slices-change', { - detail: this.slicestime, - }) - ); - } - } - }); - this.shadowRoot?.querySelector('#text-input')?.addEventListener('blur', (event: any) => { - (window as any).flagInputFocus = false; - window.publish(window.SmartEvent.UI.KeyboardEnable, { - enable: true, - }); - }); - this.shadowRoot?.querySelector('#text-input')?.addEventListener('focus', (event: any) => { - (window as any).flagInputFocus = true; - window.publish(window.SmartEvent.UI.KeyboardEnable, { - enable: false, - }); - }); - this.shadowRoot?.querySelector('#remove')?.addEventListener('click', (event: any) => { - if (this.slicestime) { - this.slicestime.hidden = true; - document.dispatchEvent(new CustomEvent('slices-change', { detail: this.slicestime })); - } - }); - } - - setCurrentSlicesTime(slicestime: SlicesTime) { - this.slicestime = slicestime; - this.shadowRoot!.querySelector('#color-input')!.value = this.slicestime.color; - this.shadowRoot!.querySelector('#text-input')!.value = this.slicestime.text; - } - - initHtml(): string { - return ` - -
-
Annotation at
- - Change color: - -
- `; - } -} diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts index 74e66f85..88bb872a 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts @@ -28,7 +28,6 @@ import { queryThreadStateArgs, queryThreadWakeUp, queryThreadWakeUpFrom, - queryCPUWakeUpIdFromBean, } from '../../../database/SqlLite.js'; import { WakeupBean } from '../../../bean/WakeupBean.js'; import { SpApplication } from '../../../SpApplication.js'; @@ -44,7 +43,6 @@ import { BinderArgBean } from '../../../bean/BinderArgBean.js'; import { JankStruct } from '../../../database/ui-worker/ProcedureWorkerJank.js'; import { LitIcon } from '../../../../base-ui/icon/LitIcon.js'; import { Utils } from '../base/Utils.js'; -import { SpSystemTrace } from '../../SpSystemTrace.js'; const INPUT_WORD = 'This is the interval from when the task became eligible to run \n(e.g.because of notifying a wait queue it was a suspended on) to\n when it started running.'; @@ -168,8 +166,6 @@ export class TabPaneCurrentSelection extends BaseElement { this.currentSelectionTbl!.dataSource = list; let rightArea: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#table-right'); let rightTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightTitle'); - let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton') - ?.shadowRoot?.querySelector("#custom-button"); let threadClick = this.currentSelectionTbl?.shadowRoot?.querySelector('#thread-id'); threadClick?.addEventListener('click', () => { //cpu点击 @@ -185,8 +181,6 @@ export class TabPaneCurrentSelection extends BaseElement { } if (rightTitle != null && rightTitle) { rightTitle.style.visibility = 'visible'; - rightButton!.style.visibility = 'visible'; - SpSystemTrace.btnTimer = null; } this.drawRight(canvas, bean); } else { @@ -196,7 +190,6 @@ export class TabPaneCurrentSelection extends BaseElement { } if (rightTitle != null && rightTitle) { rightTitle.style.visibility = 'hidden'; - rightButton!.style.visibility = 'hidden'; } } }); @@ -339,11 +332,8 @@ export class TabPaneCurrentSelection extends BaseElement { this.initCanvas(); let leftTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#leftTitle'); let rightTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightTitle'); - let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton') - ?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; - rightButton!.style.visibility = 'hidden'; } if (leftTitle) { leftTitle.innerText = leftTitleStr; @@ -393,11 +383,8 @@ export class TabPaneCurrentSelection extends BaseElement { this.setTableHeight('300px'); this.initCanvas(); let rightTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightTitle'); - let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton') - ?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; - rightButton!.style.visibility = 'hidden'; } let leftTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#leftTitle'); if (leftTitle) { @@ -430,11 +417,8 @@ export class TabPaneCurrentSelection extends BaseElement { this.initCanvas(); let leftTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#leftTitle'); let rightTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightTitle'); - let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton') - ?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; - rightButton!.style.visibility = 'hidden'; } if (leftTitle) { leftTitle.innerText = 'Thread State'; @@ -826,10 +810,6 @@ export class TabPaneCurrentSelection extends BaseElement { if (wf && wf[0]) { wb = wf[0]; if (wb != null) { - let wd = await queryCPUWakeUpIdFromBean(wb.tid); - if (wd && wd[0]) { - wb.itid = wd[0].itid; - } wb.wakeupTime = wakeupTs - recordStartTs; wb.process = Utils.PROCESS_MAP.get(wb.pid!); wb.thread = Utils.THREAD_MAP.get(wb.tid!); @@ -847,40 +827,6 @@ export class TabPaneCurrentSelection extends BaseElement { return wb; } - /** - * 查询出 线程被唤醒的 线程链信息 - * @param data - */ - static async queryCPUWakeUpListFromBean(data: WakeupBean) { - let wb: WakeupBean | null = null; - let wakeup = await queryRunnableTimeByRunning(data.tid!, data.ts!); - if (wakeup && wakeup[0]) { - let wakeupTs = wakeup[0].ts as number; - let recordStartTs = (window as any).recordStartNS; - let wf = await queryThreadWakeUpFrom(data.itid!, wakeupTs); - if (wf && wf[0]) { - wb = wf[0]; - if (wb != null) { - let wd = await queryCPUWakeUpIdFromBean(wb.tid); - if (wd && wd[0]) { - wb.itid = wd[0].itid; - } - wb.wakeupTime = wakeupTs - recordStartTs; - wb.process = Utils.PROCESS_MAP.get(wb.pid!); - wb.thread = Utils.THREAD_MAP.get(wb.tid!); - wb.schedulingLatency = (data.ts || 0) - (wb.wakeupTime || 0); - if (wb.process === null) { - wb.process = wb.thread; - } - if (wb.pid === undefined) { - wb.pid = wb.tid; - } - wb.schedulingDesc = INPUT_WORD; - } - } - } - return wb; - } /** * 查询出 线程唤醒了哪些线程信息 */ @@ -1026,29 +972,13 @@ export class TabPaneCurrentSelection extends BaseElement { width: 100%; display: flex; } - .table-title > h2{ + .table-title h2{ font-size: 16px; font-weight: 400; visibility: visible; width: 50%; padding: 0 10px; } - #rightTitle{ - width: 50%; - display: flex; - justify-content: space-between; - padding: 0 10px; - font-size: 16px; - font-weight: 400; - visibility: visible; - } - #rightTitle > h2{ - font-size: 16px; - font-weight: 400; - } - #rightButton{ - padding-top:12px; - } .scroll-area{ display: flex; flex-direction: row; @@ -1056,7 +986,7 @@ export class TabPaneCurrentSelection extends BaseElement { } .table-left{ width: 50%; - height: 500px; + height: auto; padding: 0 10px; } .table-right{ @@ -1067,13 +997,7 @@ export class TabPaneCurrentSelection extends BaseElement {

-
-

Scheduling Latency

-
- GetWakeupList -
-
+

Scheduling Latency

diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts index 8d0d4ccf..9600f5f8 100644 --- a/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts +++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneCounterSample.ts @@ -91,7 +91,7 @@ export class TabPaneCounterSample extends BaseElement { }); let counterSampleList: Array = []; sampleMap.forEach((a) => { - a.timeStr = parseFloat((a.time / 1000000.0).toFixed(6)); + a.timeStr = Utils.getProbablyTime(a.time); counterSampleList.push(a); }); this.counterSampleSource = counterSampleList; @@ -194,7 +194,7 @@ export class TabPaneCounterSample extends BaseElement { - + diff --git a/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts b/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts index 71cf7567..9634e733 100644 --- a/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts +++ b/ide/src/trace/component/trace/sheet/cpu/TabPaneFrequencySample.ts @@ -93,7 +93,7 @@ export class TabPaneFrequencySample extends BaseElement { let frqSampleList: Array = []; sampleMap.forEach((a) => { - a.timeStr = parseFloat((a.time / 1000000.0).toFixed(6)); + a.timeStr = Utils.getProbablyTime(a.time); frqSampleList.push(a); }); this.frequencySampleSource = frqSampleList; @@ -126,7 +126,7 @@ export class TabPaneFrequencySample extends BaseElement { sampleMap.set(item.filterId + '-' + item.value, { ...item, counter: 'Cpu ' + item.cpu, - valueStr: ColorUtils.formatNumberComma(item.value), + valueStr: ColorUtils.formatNumberComma(item.value) + ' kHz', }); } }); @@ -194,9 +194,9 @@ export class TabPaneFrequencySample extends BaseElement { - + - + diff --git a/ide/src/trace/component/trace/sheet/file-system/TabPaneFilesystemStatisticsAnalysis.ts b/ide/src/trace/component/trace/sheet/file-system/TabPaneFilesystemStatisticsAnalysis.ts index 276a3b1c..20eca20e 100644 --- a/ide/src/trace/component/trace/sheet/file-system/TabPaneFilesystemStatisticsAnalysis.ts +++ b/ide/src/trace/component/trace/sheet/file-system/TabPaneFilesystemStatisticsAnalysis.ts @@ -25,7 +25,7 @@ import { procedurePool } from '../../../../database/Procedure.js'; @element('tabpane-file-statistics-analysis') export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { private fileStatisticsAnalysisPie: LitChartPie | null | undefined; - private fileStatisticsAnalysisCurrentSelection: SelectionParam | any; + private fileStatisticsAnalysisCurrentSelection: SelectionParam | null | undefined; private fileStatisticsAnalysisProcessData: any; private fileStatisticsAnalysisThreadData!: any[]; private fileStatisticsAnalysisSoData!: any[]; @@ -37,7 +37,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { private fileStatisticsAnalysisTableThread: LitTable | null | undefined; private fileStatisticsAnalysisTableSo: LitTable | null | undefined; private fileStatisticsAnalysisTableFunction: LitTable | null | undefined; - private sumDur: any; + private sumDur: number = 0; private fileStatisticsAnalysisRange: HTMLLabelElement | null | undefined; private back: HTMLDivElement | null | undefined; private tabName: HTMLDivElement | null | undefined; @@ -46,15 +46,15 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { private fileStatisticsAnalysisThreadName: string = ''; private fileStatisticsAnalysisSortColumn: string = ''; private fileStatisticsAnalysisSortType: number = 0; - private typeName: any; + private typeName: string = ''; private currentLevel = -1; private currentLevelData!: Array; - private processStatisticsData!: any; - private typeStatisticsData!: any; - private threadStatisticsData!: any; - private libStatisticsData!: any; - private functionStatisticsData!: any; - set data(val: SelectionParam | any) { + private processStatisticsData!: {}; + private typeStatisticsData!: {}; + private threadStatisticsData!: {}; + private libStatisticsData!: {}; + private functionStatisticsData!: {}; + set data(val: SelectionParam) { if (val === this.fileStatisticsAnalysisCurrentSelection) { this.fileStatisticsAnalysisPidData.unshift(this.processStatisticsData); this.fileStatisticsAnalysisTableProcess!.recycleDataSource = this.fileStatisticsAnalysisPidData; @@ -70,6 +70,8 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.fileStatisticsAnalysisTableType!.style.display = 'none'; this.fileStatisticsAnalysisTableFunction!.style.display = 'none'; this.back!.style.visibility = 'hidden'; + this.shadowRoot!.querySelector('.title')!.textContent = ''; + this.tabName!.textContent = ''; this.fileStatisticsAnalysisRange!.textContent = 'Selected range: ' + parseFloat(((val.rightNs - val.leftNs) / 1000000.0).toFixed(5)) + ' ms'; this.fileStatisticsAnalysisProgressEL!.loading = true; @@ -85,7 +87,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], (results: any[]) => { - this.getFilesystemProcess(val, results); + this.getFilesystemProcess(results); } ); } @@ -119,32 +121,33 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.fileStatisticsAnalysisTableType!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableProcess?.removeAttribute('hideDownload'); this.currentLevel = 0; - this.processPieChart(this.fileStatisticsAnalysisCurrentSelection); + this.processPieChart(); } else if (this.tabName!.textContent === 'Statistic By Thread AllDuration') { this.fileStatisticsAnalysisTableType!.style.display = 'grid'; this.fileStatisticsAnalysisTableThread!.style.display = 'none'; this.fileStatisticsAnalysisTableThread!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableType?.removeAttribute('hideDownload'); this.currentLevel = 1; - this.typePieChart(this.fileStatisticsAnalysisCurrentSelection); + this.typePieChart(); } else if (this.tabName!.textContent === 'Statistic By Library AllDuration') { this.fileStatisticsAnalysisTableThread!.style.display = 'grid'; this.fileStatisticsAnalysisTableSo!.style.display = 'none'; this.fileStatisticsAnalysisTableSo!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableThread?.removeAttribute('hideDownload'); this.currentLevel = 2; - this.threadPieChart(this.fileStatisticsAnalysisCurrentSelection); + this.threadPieChart(); } else if (this.tabName!.textContent === 'Statistic By Function AllDuration') { this.fileStatisticsAnalysisTableSo!.style.display = 'grid'; this.fileStatisticsAnalysisTableFunction!.style.display = 'none'; this.fileStatisticsAnalysisTableFunction!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableSo?.removeAttribute('hideDownload'); this.currentLevel = 3; - this.libraryPieChart(this.fileStatisticsAnalysisCurrentSelection); + this.libraryPieChart(); } }); } - processPieChart(val: any) { + processPieChart() { + // @ts-ignore this.sumDur = this.processStatisticsData.allDuration; this.fileStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -166,7 +169,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.fileProcessLevelClickEvent(it, val); + this.fileProcessLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -182,12 +185,14 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], }; - this.fileStatisticsAnalysisTableProcess!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let fspData = evt.detail.data; + this.fileStatisticsAnalysisTableProcess!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let processData = evt.detail; + if (processData.data) { + let fspData = processData.data; fspData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (processData.callBack) { + processData.callBack(true); } } this.fileStatisticsAnalysisPie?.showHover(); @@ -205,27 +210,28 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.fileStatisticsAnalysisTableProcess!.addEventListener('row-click', (evt: any) => { + this.fileStatisticsAnalysisTableProcess!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.fileProcessLevelClickEvent(data, val); + this.fileProcessLevelClickEvent(data); } }); } - fileProcessLevelClickEvent(it: any, val: any) { + fileProcessLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.fileStatisticsAnalysisTableProcess!.style.display = 'none'; this.fileStatisticsAnalysisTableType!.style.display = 'grid'; this.fileStatisticsAnalysisTableProcess!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableType?.removeAttribute('hideDownload'); - this.getFilesystemType(it, val); + this.getFilesystemType(it); // @ts-ignore this.fileStatisticsAnalysisProcessName = it.tableName; this.shadowRoot!.querySelector('.title')!.textContent = this.fileStatisticsAnalysisProcessName; this.fileStatisticsAnalysisPie?.hideTip(); } - typePieChart(val: any) { + typePieChart() { this.fileStatisticsAnalysisPie!.config = { appendPadding: 0, data: this.fileStatisticsAnalysisTypeData, @@ -244,7 +250,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { `; }, angleClick: (it) => { - this.fileTypeLevelClickEvent(it, val); + this.fileTypeLevelClickEvent(it); }, hoverHandler: (data) => { if (data) { @@ -259,12 +265,14 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], }; - this.fileStatisticsAnalysisTableType!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let fsaData = evt.detail.data; + this.fileStatisticsAnalysisTableType!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let typeData = evt.detail; + if (typeData.data) { + let fsaData = typeData.data; fsaData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (typeData.callBack) { + typeData.callBack(true); } } this.fileStatisticsAnalysisPie?.showHover(); @@ -282,27 +290,29 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.fileStatisticsAnalysisTableType!.addEventListener('row-click', (evt: any) => { + this.fileStatisticsAnalysisTableType!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.fileTypeLevelClickEvent(data, val); + this.fileTypeLevelClickEvent(data); } }); } - fileTypeLevelClickEvent(it: any, val: any) { + fileTypeLevelClickEvent(it: any) { this.clearData(); this.fileStatisticsAnalysisTableType!.style.display = 'none'; this.fileStatisticsAnalysisTableThread!.style.display = 'grid'; this.fileStatisticsAnalysisTableType!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableThread?.removeAttribute('hideDownload'); - this.getFilesystemThread(it, val); + this.getFilesystemThread(it); // @ts-ignore this.typeName = it.tableName; this.shadowRoot!.querySelector('.title')!.textContent = this.fileStatisticsAnalysisProcessName + ' / ' + this.typeName; this.fileStatisticsAnalysisPie?.hideTip(); } - threadPieChart(val: any) { + threadPieChart() { + // @ts-ignore this.sumDur = this.threadStatisticsData.allDuration; this.fileStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -324,7 +334,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.fileThreadLevelClickEvent(it, val); + this.fileThreadLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -340,12 +350,14 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], }; - this.fileStatisticsAnalysisTableThread!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let tableData = evt.detail.data; + this.fileStatisticsAnalysisTableThread!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let threadData = evt.detail; + if (threadData.data) { + let tableData = threadData.data; tableData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (threadData.callBack) { + threadData.callBack(true); } } this.fileStatisticsAnalysisPie?.showHover(); @@ -364,28 +376,30 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.fileStatisticsAnalysisTableThread!.addEventListener('row-click', (evt: any) => { + this.fileStatisticsAnalysisTableThread!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.fileThreadLevelClickEvent(data, val); + this.fileThreadLevelClickEvent(data); } }); } - fileThreadLevelClickEvent(it: any, val: any) { + fileThreadLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.fileStatisticsAnalysisTableThread!.style.display = 'none'; this.fileStatisticsAnalysisTableSo!.style.display = 'grid'; this.fileStatisticsAnalysisTableThread!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableSo?.removeAttribute('hideDownload'); - this.getFilesystemSo(it, val); + this.getFilesystemSo(it); // @ts-ignore this.fileStatisticsAnalysisThreadName = it.tableName; this.shadowRoot!.querySelector('.title')!.textContent = this.fileStatisticsAnalysisProcessName + ' / ' + this.typeName + ' / ' + this.fileStatisticsAnalysisThreadName; this.fileStatisticsAnalysisPie?.hideTip(); } - libraryPieChart(val: any) { + libraryPieChart() { + // @ts-ignore this.sumDur = this.libStatisticsData.allDuration; this.fileStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -407,7 +421,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.fileSoLevelClickEvent(it, val); + this.fileSoLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -423,12 +437,14 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], }; - this.fileStatisticsAnalysisTableSo!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let fsSoData = evt.detail.data; + this.fileStatisticsAnalysisTableSo!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let soData = evt.detail; + if (soData.data) { + let fsSoData = soData.data; fsSoData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (soData.callBack) { + soData.callBack(true); } } this.fileStatisticsAnalysisPie?.showHover(); @@ -447,21 +463,22 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.fileStatisticsAnalysisTableSo!.addEventListener('row-click', (evt: any) => { + this.fileStatisticsAnalysisTableSo!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.fileSoLevelClickEvent(data, val); + this.fileSoLevelClickEvent(data); } }); } - fileSoLevelClickEvent(it: any, val: any) { + fileSoLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.fileStatisticsAnalysisTableSo!.style.display = 'none'; this.fileStatisticsAnalysisTableFunction!.style.display = 'grid'; this.fileStatisticsAnalysisTableSo!.setAttribute('hideDownload', ''); this.fileStatisticsAnalysisTableFunction?.removeAttribute('hideDownload'); - this.getFilesystemFunction(it, val); + this.getFilesystemFunction(it); this.shadowRoot!.querySelector('.title')!.textContent = // @ts-ignore this.fileStatisticsAnalysisProcessName + @@ -564,22 +581,22 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { fsaCurrentTable!.recycleDataSource = fsaArr; } } - getFilesystemProcess(val: any, result: Array) { + getFilesystemProcess(result: Array) { this.fileStatisticsAnalysisProcessData = JSON.parse(JSON.stringify(result)); if (!this.fileStatisticsAnalysisProcessData || this.fileStatisticsAnalysisProcessData.length === 0) { this.fileStatisticsAnalysisPidData = []; this.processStatisticsData = []; - this.processPieChart(val); + this.processPieChart(); return; } let allDur = 0; - let pidMap = new Map>(); + let pidMap = new Map>(); for (let itemData of result) { allDur += itemData.dur; if (pidMap.has(itemData.pid)) { pidMap.get(itemData.pid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); pidMap.set(itemData.pid, itemArray); } @@ -608,21 +625,26 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.processStatisticsData = this.totalDurationData(allDur); this.currentLevel = 0; this.fileStatisticsAnalysisProgressEL!.loading = false; - this.processPieChart(val); + this.processPieChart(); new ResizeObserver(() => { if (this.parentElement?.clientHeight != 0) { - this.fileStatisticsAnalysisTableProcess!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.fileStatisticsAnalysisTableThread!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.fileStatisticsAnalysisTableSo!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.fileStatisticsAnalysisTableFunction!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.fileStatisticsAnalysisTableType!.style.height = this.parentElement!.clientHeight - 40 + 'px'; + this.fileStatisticsAnalysisTableProcess!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.fileStatisticsAnalysisTableProcess?.reMeauseHeight(); + this.fileStatisticsAnalysisTableThread!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.fileStatisticsAnalysisTableThread?.reMeauseHeight(); + this.fileStatisticsAnalysisTableSo!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.fileStatisticsAnalysisTableSo?.reMeauseHeight(); + this.fileStatisticsAnalysisTableFunction!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.fileStatisticsAnalysisTableFunction?.reMeauseHeight(); + this.fileStatisticsAnalysisTableType!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.fileStatisticsAnalysisTableType?.reMeauseHeight(); } }).observe(this.parentElement!); } - getFilesystemType(item: any, val: any) { + getFilesystemType(item: any) { this.fileStatisticsAnalysisProgressEL!.loading = true; - let typeMap = new Map>(); + let typeMap = new Map>(); let pid = item.pid; let allDur = 0; if (!this.fileStatisticsAnalysisProcessData || this.fileStatisticsAnalysisProcessData.length == 0) { @@ -636,13 +658,13 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { if (typeMap.has(fsItem.type)) { typeMap.get(fsItem.type)?.push(fsItem); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(fsItem); typeMap.set(fsItem.type, itemArray); } } this.fileStatisticsAnalysisTypeData = []; - typeMap.forEach((value: Array, key: string) => { + typeMap.forEach((value: Array, key: number) => { let dur = 0; for (let item of value) { dur += item.dur; @@ -660,13 +682,13 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.fileStatisticsAnalysisTypeData.sort((a, b) => b.duration - a.duration); this.typeStatisticsData = this.totalDurationData(allDur); this.currentLevel = 1; - this.typePieChart(val); + this.typePieChart(); this.fileStatisticsAnalysisProgressEL!.loading = false; } - getFilesystemThread(item: any, val: any) { + getFilesystemThread(item: any) { this.fileStatisticsAnalysisProgressEL!.loading = true; - let threadMap = new Map>(); + let threadMap = new Map>(); let pid = item.pid; let type = item.type; let allDur = 0; @@ -681,7 +703,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { if (threadMap.has(fspItem.tid)) { threadMap.get(fspItem.tid)?.push(fspItem); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(fspItem); threadMap.set(fspItem.tid, itemArray); } @@ -710,16 +732,16 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.threadStatisticsData = this.totalDurationData(allDur); this.currentLevel = 2; this.fileStatisticsAnalysisProgressEL!.loading = false; - this.threadPieChart(val); + this.threadPieChart(); } - getFilesystemSo(item: any, val: any) { + getFilesystemSo(item: any) { this.fileStatisticsAnalysisProgressEL!.loading = true; let tid = item.tid; let pid = item.pid; let type = item.type; let allDur = 0; - let libMap = new Map>(); + let libMap = new Map>(); if (!this.fileStatisticsAnalysisProcessData || this.fileStatisticsAnalysisProcessData.length === 0) { return; } @@ -731,7 +753,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { if (libMap.has(itemData.libId)) { libMap.get(itemData.libId)?.push(itemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(itemData); libMap.set(itemData.libId, dataArray); } @@ -767,10 +789,10 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.libStatisticsData = this.totalDurationData(allDur); this.currentLevel = 3; this.fileStatisticsAnalysisProgressEL!.loading = false; - this.libraryPieChart(val); + this.libraryPieChart(); } - getFilesystemFunction(item: any, val: any) { + getFilesystemFunction(item: any) { this.fileStatisticsAnalysisProgressEL!.loading = true; this.shadowRoot!.querySelector('.subheading')!.textContent = 'Statistic By Function AllDuration'; let tid = item.tid; @@ -795,7 +817,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { if (symbolMap.has(fsProcessData.symbolId)) { symbolMap.get(fsProcessData.symbolId)?.push(fsProcessData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(fsProcessData); symbolMap.set(fsProcessData.symbolId, dataArray); } @@ -826,6 +848,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.functionStatisticsData = this.totalDurationData(allDur); this.currentLevel = 4; this.fileStatisticsAnalysisProgressEL!.loading = false; + // @ts-ignore this.sumDur = this.functionStatisticsData.allDuration; this.fileStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -857,12 +880,14 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { }, ], }; - this.fileStatisticsAnalysisTableFunction!.addEventListener('row-hover', (fsStatRowClickEvent: any) => { - if (fsStatRowClickEvent.detail.data) { - let data = fsStatRowClickEvent.detail.data; + this.fileStatisticsAnalysisTableFunction!.addEventListener('row-hover', (fsStatRowClickEvent) => { + // @ts-ignore + let fsFunctionData = fsStatRowClickEvent.detail; + if (fsFunctionData.data) { + let data = fsFunctionData.data; data.isHover = true; - if ((fsStatRowClickEvent.detail as any).callBack) { - (fsStatRowClickEvent.detail as any).callBack(true); + if (fsFunctionData.callBack) { + fsFunctionData.callBack(true); } } this.fileStatisticsAnalysisPie?.showHover(); @@ -879,8 +904,8 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { this.sortByColumn(evt.detail.key, evt.detail.sort); }); } - typeIdToString(transformType: any) { - let releaseType: any; + typeIdToString(transformType: number) { + let releaseType: string; if (transformType === 0) { releaseType = 'OPEN'; } else if (transformType === 2) { @@ -890,9 +915,10 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { } else if (transformType === 1) { releaseType = 'CLOSE'; } + // @ts-ignore return releaseType; } - totalDurationData(duration: any) { + totalDurationData(duration: number) { let allDuration; allDuration = { durFormat: Utils.getProbablyTime(duration), @@ -904,7 +930,7 @@ export class TabPaneFilesystemStatisticsAnalysis extends BaseElement { } getPieChartData(pieChartData: any[]) { if (pieChartData.length > 20) { - let pieChartArr: any[] = []; + let pieChartArr: string[] = []; let other: any = { tableName: 'other', duration: 0, diff --git a/ide/src/trace/component/trace/sheet/file-system/TabPaneIOTierStatisticsAnalysis.ts b/ide/src/trace/component/trace/sheet/file-system/TabPaneIOTierStatisticsAnalysis.ts index 2e33eeb2..8c01e3c8 100644 --- a/ide/src/trace/component/trace/sheet/file-system/TabPaneIOTierStatisticsAnalysis.ts +++ b/ide/src/trace/component/trace/sheet/file-system/TabPaneIOTierStatisticsAnalysis.ts @@ -25,7 +25,7 @@ import { procedurePool } from '../../../../database/Procedure.js'; @element('tabpane-tb-vm-statistics') export class TabPaneIOTierStatisticsAnalysis extends BaseElement { private iOTierStatisticsAnalysisPie: LitChartPie | null | undefined; - private currentSelection: SelectionParam | any; + private currentSelection: SelectionParam | null | undefined; private processData: any; private pidData!: any[]; private threadData!: any[]; @@ -37,7 +37,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { private tableType: LitTable | null | undefined; private tableSo: LitTable | null | undefined; private tableFunction: LitTable | null | undefined; - private sumDur: any; + private sumDur: number = 0; private range: HTMLLabelElement | null | undefined; private iOTierStatisticsAnalysisBack: HTMLDivElement | null | undefined; private tabName: HTMLDivElement | null | undefined; @@ -46,15 +46,15 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { private threadName: string = ''; private sortColumn: string = ''; private sortType: number = 0; - private typeName: any; + private typeName: string = ''; private currentLevel = -1; private currentLevelData!: Array; - private processStatisticsData!: any; - private typeStatisticsData!: any; - private threadStatisticsData!: any; - private libStatisticsData!: any; - private functionStatisticsData!: any; - set data(ioTierStatisticsAnalysisSelection: SelectionParam | any) { + private processStatisticsData!: {}; + private typeStatisticsData!: {}; + private threadStatisticsData!: {}; + private libStatisticsData!: {}; + private functionStatisticsData!: {}; + set data(ioTierStatisticsAnalysisSelection: SelectionParam) { if (ioTierStatisticsAnalysisSelection === this.currentSelection) { this.pidData.unshift(this.processStatisticsData); this.tableProcess!.recycleDataSource = this.pidData; @@ -70,6 +70,8 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.tableSo!.style.display = 'none'; this.tableFunction!.style.display = 'none'; this.iOTierStatisticsAnalysisBack!.style.visibility = 'hidden'; + this.shadowRoot!.querySelector('.title')!.textContent = ''; + this.tabName!.textContent = ''; this.range!.textContent = 'Selected range: ' + parseFloat( @@ -89,7 +91,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], (results: any[]) => { - this.getIOTierProcess(ioTierStatisticsAnalysisSelection, results); + this.getIOTierProcess(results); } ); } @@ -123,32 +125,33 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.tableType!.setAttribute('hideDownload', ''); this.tableProcess?.removeAttribute('hideDownload'); this.currentLevel = 0; - this.processPieChart(this.currentSelection); + this.processPieChart(); } else if (this.tabName!.textContent === 'Statistic By Thread AllDuration') { this.tableType!.style.display = 'grid'; this.tableThread!.style.display = 'none'; this.tableThread!.setAttribute('hideDownload', ''); this.tableType?.removeAttribute('hideDownload'); this.currentLevel = 1; - this.typePieChart(this.currentSelection); + this.typePieChart(); } else if (this.tabName!.textContent === 'Statistic By Library AllDuration') { this.tableThread!.style.display = 'grid'; this.tableSo!.style.display = 'none'; this.tableSo!.setAttribute('hideDownload', ''); this.tableThread?.removeAttribute('hideDownload'); this.currentLevel = 2; - this.threadPieChart(this.currentSelection); + this.threadPieChart(); } else if (this.tabName!.textContent === 'Statistic By Function AllDuration') { this.tableSo!.style.display = 'grid'; this.tableFunction!.style.display = 'none'; this.tableFunction!.setAttribute('hideDownload', ''); this.tableSo?.removeAttribute('hideDownload'); this.currentLevel = 3; - this.libraryPieChart(this.currentSelection); + this.libraryPieChart(); } }); } - processPieChart(val: any) { + processPieChart() { + // @ts-ignore this.sumDur = this.processStatisticsData.allDuration; this.iOTierStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -170,7 +173,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.ioTierProcessLevelClickEvent(it, val); + this.ioTierProcessLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -186,12 +189,14 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], }; - this.tableProcess!.addEventListener('row-hover', (event: any) => { - if (event.detail.data) { - let processData = event.detail.data; + this.tableProcess!.addEventListener('row-hover', (event) => { + // @ts-ignore + let ioProcessData = event.detail; + if (ioProcessData.data) { + let processData = ioProcessData.data; processData.isHover = true; - if ((event.detail as any).callBack) { - (event.detail as any).callBack(true); + if (ioProcessData.callBack) { + ioProcessData.callBack(true); } } this.iOTierStatisticsAnalysisPie?.showHover(); @@ -209,26 +214,27 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableProcess!.addEventListener('row-click', (evt: any) => { + this.tableProcess!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.ioTierProcessLevelClickEvent(data, val); + this.ioTierProcessLevelClickEvent(data); } }); } - ioTierProcessLevelClickEvent(it: any, val: any) { + ioTierProcessLevelClickEvent(it: any) { this.clearData(); this.iOTierStatisticsAnalysisBack!.style.visibility = 'visible'; this.tableProcess!.style.display = 'none'; this.tableType!.style.display = 'grid'; this.tableProcess!.setAttribute('hideDownload', ''); this.tableType?.removeAttribute('hideDownload'); - this.getIOTierType(it, val); + this.getIOTierType(it); this.processName = it.tableName; this.iOTierStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName; } - typePieChart(val: any) { + typePieChart() { this.iOTierStatisticsAnalysisPie!.config = { appendPadding: 0, data: this.typeData, @@ -247,7 +253,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { `; }, angleClick: (it) => { - this.ioTierTypeLevelClickEvent(it, val); + this.ioTierTypeLevelClickEvent(it); }, hoverHandler: (data) => { if (data) { @@ -262,12 +268,14 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], }; - this.tableType!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let tableData = evt.detail.data; + this.tableType!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let ioTypeData = evt.detail; + if (ioTypeData.data) { + let tableData = ioTypeData.data; tableData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (ioTypeData.callBack) { + ioTypeData.callBack(true); } } this.iOTierStatisticsAnalysisPie?.showHover(); @@ -285,25 +293,27 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableType!.addEventListener('row-click', (evt: any) => { + this.tableType!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.ioTierTypeLevelClickEvent(data, val); + this.ioTierTypeLevelClickEvent(data); } }); } - ioTierTypeLevelClickEvent(it: any, val: any) { + ioTierTypeLevelClickEvent(it: any) { this.clearData(); this.tableType!.style.display = 'none'; this.tableThread!.style.display = 'grid'; this.tableType!.setAttribute('hideDownload', ''); this.tableThread?.removeAttribute('hideDownload'); - this.getIOTierThread(it, val); + this.getIOTierThread(it); this.typeName = it.tableName; this.iOTierStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName; } - threadPieChart(val: any) { + threadPieChart() { + // @ts-ignore this.sumDur = this.threadStatisticsData.allDuration; this.iOTierStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -325,7 +335,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.ioTierThreadLevelClickEvent(it, val); + this.ioTierThreadLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -341,12 +351,14 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], }; - this.tableThread!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let threadData = evt.detail.data; + this.tableThread!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let ioThreadData = evt.detail; + if (ioThreadData.data) { + let threadData = ioThreadData.data; threadData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (ioThreadData.callBack) { + ioThreadData.callBack(true); } } this.iOTierStatisticsAnalysisPie?.showHover(); @@ -364,27 +376,29 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableThread!.addEventListener('row-click', (evt: any) => { + this.tableThread!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.ioTierThreadLevelClickEvent(data, val); + this.ioTierThreadLevelClickEvent(data); } }); } - ioTierThreadLevelClickEvent(it: any, val: any) { + ioTierThreadLevelClickEvent(it: any) { this.clearData(); this.iOTierStatisticsAnalysisBack!.style.visibility = 'visible'; this.tableThread!.style.display = 'none'; this.tableSo!.style.display = 'grid'; this.tableThread!.setAttribute('hideDownload', ''); this.tableSo?.removeAttribute('hideDownload'); - this.getIOTierSo(it, val); + this.getIOTierSo(it); this.threadName = it.tableName; this.iOTierStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName + ' / ' + this.threadName; } - libraryPieChart(val: any) { + libraryPieChart() { + // @ts-ignore this.sumDur = this.libStatisticsData.allDuration; this.iOTierStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -406,7 +420,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.ioTierSoLevelClickEvent(it, val); + this.ioTierSoLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -422,12 +436,14 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], }; - this.tableSo!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let soData = evt.detail.data; + this.tableSo!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let ioSoData = evt.detail; + if (ioSoData.data) { + let soData = ioSoData.data; soData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (ioSoData.callBack) { + ioSoData.callBack(true); } } this.iOTierStatisticsAnalysisPie?.showHover(); @@ -446,21 +462,22 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableSo!.addEventListener('row-click', (evt: any) => { + this.tableSo!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.ioTierSoLevelClickEvent(data, val); + this.ioTierSoLevelClickEvent(data); } }); } - ioTierSoLevelClickEvent(it: any, val: any) { + ioTierSoLevelClickEvent(it: any) { this.clearData(); this.iOTierStatisticsAnalysisBack!.style.visibility = 'visible'; this.tableSo!.style.display = 'none'; this.tableFunction!.style.display = 'grid'; this.tableSo!.setAttribute('hideDownload', ''); this.tableFunction?.removeAttribute('hideDownload'); - this.getIOTierFunction(it, val); + this.getIOTierFunction(it); this.iOTierStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName + ' / ' + this.threadName + ' / ' + it.tableName; @@ -556,22 +573,22 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { currentTable!.recycleDataSource = ioArr; } } - getIOTierProcess(val: any, result: Array) { + getIOTierProcess(result: Array) { this.processData = JSON.parse(JSON.stringify(result)); if (!this.processData || this.processData.length === 0) { this.pidData = []; this.processStatisticsData = []; - this.processPieChart(val); + this.processPieChart(); return; } let allDur = 0; - let ioMap = new Map>(); + let ioMap = new Map>(); for (let itemData of result) { allDur += itemData.dur; if (ioMap.has(itemData.pid)) { ioMap.get(itemData.pid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); ioMap.set(itemData.pid, itemArray); } @@ -600,20 +617,25 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.processStatisticsData = this.totalDurationData(allDur); this.currentLevel = 0; this.progressEL!.loading = false; - this.processPieChart(val); + this.processPieChart(); new ResizeObserver(() => { if (this.parentElement?.clientHeight != 0) { - this.tableProcess!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableThread!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableSo!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableFunction!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableType!.style.height = this.parentElement!.clientHeight - 40 + 'px'; + this.tableProcess!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableProcess?.reMeauseHeight(); + this.tableThread!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableThread?.reMeauseHeight(); + this.tableSo!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableSo?.reMeauseHeight(); + this.tableFunction!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableFunction?.reMeauseHeight(); + this.tableType!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableType?.reMeauseHeight(); } }).observe(this.parentElement!); } - getIOTierType(item: any, val: any) { + getIOTierType(item: any) { this.progressEL!.loading = true; - let typeMap = new Map>(); + let typeMap = new Map>(); let pid = item.pid; let allDur = 0; if (!this.processData || this.processData.length === 0) { @@ -627,13 +649,13 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { if (typeMap.has(processItem.type)) { typeMap.get(processItem.type)?.push(processItem); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(processItem); typeMap.set(processItem.type, itemArray); } } this.typeData = []; - typeMap.forEach((value: Array, key: string) => { + typeMap.forEach((value: Array, key: number) => { let dur = 0; for (let item of value) { dur += item.dur; @@ -651,12 +673,12 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.typeData.sort((a, b) => b.duration - a.duration); this.typeStatisticsData = this.totalDurationData(allDur); this.currentLevel = 1; - this.typePieChart(val); + this.typePieChart(); this.progressEL!.loading = false; } - getIOTierThread(item: any, val: any) { + getIOTierThread(item: any) { this.progressEL!.loading = true; - let threadMap = new Map>(); + let threadMap = new Map>(); let pid = item.pid; let type = item.type; let allDur = 0; @@ -671,7 +693,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { if (threadMap.has(itemData.tid)) { threadMap.get(itemData.tid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); threadMap.set(itemData.tid, itemArray); } @@ -700,15 +722,15 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.threadStatisticsData = this.totalDurationData(allDur); this.currentLevel = 2; this.progressEL!.loading = false; - this.threadPieChart(val); + this.threadPieChart(); } - getIOTierSo(item: any, val: any) { + getIOTierSo(item: any) { this.progressEL!.loading = true; let tid = item.tid; let pid = item.pid; let type = item.type; let allDur = 0; - let libMap = new Map>(); + let libMap = new Map>(); if (!this.processData || this.processData.length === 0) { return; } @@ -720,7 +742,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { if (libMap.has(processItemData.libId)) { libMap.get(processItemData.libId)?.push(processItemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(processItemData); libMap.set(processItemData.libId, dataArray); } @@ -756,9 +778,9 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.libStatisticsData = this.totalDurationData(allDur); this.currentLevel = 3; this.progressEL!.loading = false; - this.libraryPieChart(val); + this.libraryPieChart(); } - getIOTierFunction(item: any, val: any) { + getIOTierFunction(item: any) { this.progressEL!.loading = true; this.shadowRoot!.querySelector('.subheading')!.textContent = 'Statistic By Function AllDuration'; let tid = item.tid; @@ -783,7 +805,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { if (symbolMap.has(processData.symbolId)) { symbolMap.get(processData.symbolId)?.push(processData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(processData); symbolMap.set(processData.symbolId, dataArray); } @@ -814,6 +836,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.functionStatisticsData = this.totalDurationData(allDur); this.currentLevel = 4; this.progressEL!.loading = false; + // @ts-ignore this.sumDur = this.functionStatisticsData.allDuration; this.iOTierStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -845,12 +868,14 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { }, ], }; - this.tableFunction!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let funData = evt.detail.data; + this.tableFunction!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let ioFunctionData = evt.detail; + if (ioFunctionData.data) { + let funData = ioFunctionData.data; funData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (ioFunctionData.callBack) { + ioFunctionData.callBack(true); } } this.iOTierStatisticsAnalysisPie?.showHover(); @@ -867,8 +892,8 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { this.sortByColumn(evt.detail.key, evt.detail.sort); }); } - typeIdToString(type: any) { - let releaseType: any; + typeIdToString(type: number) { + let releaseType: string; if (type === 1) { releaseType = 'DATA_READ'; } else if (type === 2) { @@ -878,9 +903,10 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { } else if (type === 4) { releaseType = 'METADATA_WRITE'; } + // @ts-ignore return releaseType; } - totalDurationData(duration: any) { + totalDurationData(duration: number) { let allDuration; allDuration = { durFormat: Utils.getProbablyTime(duration), @@ -893,7 +919,7 @@ export class TabPaneIOTierStatisticsAnalysis extends BaseElement { } getPieChartData(res: any[]) { if (res.length > 20) { - let pieChartArr: any[] = []; + let pieChartArr: string[] = []; let other: any = { tableName: 'other', duration: 0, diff --git a/ide/src/trace/component/trace/sheet/file-system/TabPaneVirtualMemoryStatisticsAnalysis.ts b/ide/src/trace/component/trace/sheet/file-system/TabPaneVirtualMemoryStatisticsAnalysis.ts index 743e59a4..3348318c 100644 --- a/ide/src/trace/component/trace/sheet/file-system/TabPaneVirtualMemoryStatisticsAnalysis.ts +++ b/ide/src/trace/component/trace/sheet/file-system/TabPaneVirtualMemoryStatisticsAnalysis.ts @@ -25,7 +25,7 @@ import { procedurePool } from '../../../../database/Procedure.js'; @element('tabpane-virtual-memory-statistics-analysis') export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { private vmStatisticsAnalysisPie: LitChartPie | null | undefined; - private vmStatisticsAnalysisCurrentSelection: SelectionParam | any; + private vmStatisticsAnalysisCurrentSelection: SelectionParam | null | undefined; private vmStatisticsAnalysisProcessData: any; private vmStatisticsAnalysisPidData!: any[]; private vmStatisticsAnalysisThreadData!: any[]; @@ -37,7 +37,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { private vmStatisticsAnalysisTableThread: LitTable | null | undefined; private vmStatisticsAnalysisTableSo: LitTable | null | undefined; private vmStatisticsAnalysisTableFunction: LitTable | null | undefined; - private sumDur: any; + private sumDur: number = 0; private vmStatisticsAnalysisRange: HTMLLabelElement | null | undefined; private back: HTMLDivElement | null | undefined; private tabName: HTMLDivElement | null | undefined; @@ -49,12 +49,12 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { private vmStatisticsAnalysisSortType: number = 0; private currentLevel = -1; private currentLevelData!: Array; - private processStatisticsData!: any; - private typeStatisticsData!: any; - private threadStatisticsData!: any; - private libStatisticsData!: any; - private functionStatisticsData!: any; - set data(vmStatisticsAnalysisSelection: SelectionParam | any) { + private processStatisticsData!: {}; + private typeStatisticsData!: {}; + private threadStatisticsData!: {}; + private libStatisticsData!: {}; + private functionStatisticsData!: {}; + set data(vmStatisticsAnalysisSelection: SelectionParam) { if (vmStatisticsAnalysisSelection === this.vmStatisticsAnalysisCurrentSelection) { this.vmStatisticsAnalysisPidData.unshift(this.processStatisticsData); this.vmStatisticsAnalysisTableProcess!.recycleDataSource = this.vmStatisticsAnalysisPidData; @@ -70,6 +70,8 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.vmStatisticsAnalysisTableSo!.style.display = 'none'; this.vmStatisticsAnalysisTableFunction!.style.display = 'none'; this.back!.style.visibility = 'hidden'; + this.shadowRoot!.querySelector('.title')!.textContent = ''; + this.tabName!.textContent = ''; this.vmStatisticsAnalysisRange!.textContent = 'Selected range: ' + parseFloat( @@ -89,7 +91,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], (results: any[]) => { - this.getVirtualMemoryProcess(vmStatisticsAnalysisSelection, results); + this.getVirtualMemoryProcess(results); } ); } @@ -123,32 +125,33 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.vmStatisticsAnalysisTableType!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableProcess?.removeAttribute('hideDownload'); this.currentLevel = 0; - this.processPieChart(this.vmStatisticsAnalysisCurrentSelection); + this.processPieChart(); } else if (this.tabName!.textContent === 'Statistic By Thread AllDuration') { this.vmStatisticsAnalysisTableType!.style.display = 'grid'; this.vmStatisticsAnalysisTableThread!.style.display = 'none'; this.vmStatisticsAnalysisTableThread!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableType?.removeAttribute('hideDownload'); this.currentLevel = 1; - this.typePieChart(this.vmStatisticsAnalysisCurrentSelection); + this.typePieChart(); } else if (this.tabName!.textContent === 'Statistic By Library AllDuration') { this.vmStatisticsAnalysisTableThread!.style.display = 'grid'; this.vmStatisticsAnalysisTableSo!.style.display = 'none'; this.vmStatisticsAnalysisTableSo!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableThread?.removeAttribute('hideDownload'); this.currentLevel = 2; - this.threadPieChart(this.vmStatisticsAnalysisCurrentSelection); + this.threadPieChart(); } else if (this.tabName!.textContent === 'Statistic By Function AllDuration') { this.vmStatisticsAnalysisTableSo!.style.display = 'grid'; this.vmStatisticsAnalysisTableFunction!.style.display = 'none'; this.vmStatisticsAnalysisTableFunction!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableSo?.removeAttribute('hideDownload'); this.currentLevel = 3; - this.libraryPieChart(this.vmStatisticsAnalysisCurrentSelection); + this.libraryPieChart(); } }); } - processPieChart(val: any) { + processPieChart() { + // @ts-ignore this.sumDur = this.processStatisticsData.allDuration; this.vmStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -170,7 +173,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.vmProcessLevelClickEvent(it, val); + this.vmProcessLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -186,12 +189,14 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], }; - this.vmStatisticsAnalysisTableProcess!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let vmsData = evt.detail.data; + this.vmStatisticsAnalysisTableProcess!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let vmProcessData = evt.detail; + if (vmProcessData.data) { + let vmsData = vmProcessData.data; vmsData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (vmProcessData.callBack) { + vmProcessData.callBack(true); } } this.vmStatisticsAnalysisPie?.showHover(); @@ -209,26 +214,27 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.vmStatisticsAnalysisTableProcess!.addEventListener('row-click', (evt: any) => { + this.vmStatisticsAnalysisTableProcess!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.vmProcessLevelClickEvent(data, val); + this.vmProcessLevelClickEvent(data); } }); } - vmProcessLevelClickEvent(it: any, val: any) { + vmProcessLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.vmStatisticsAnalysisTableProcess!.style.display = 'none'; this.vmStatisticsAnalysisTableType!.style.display = 'grid'; this.vmStatisticsAnalysisTableProcess!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableType?.removeAttribute('hideDownload'); - this.getVirtualMemoryType(it, val); + this.getVirtualMemoryType(it); this.processName = it.tableName; this.shadowRoot!.querySelector('.title')!.textContent = this.processName; this.vmStatisticsAnalysisPie?.hideTip(); } - typePieChart(val: any) { + typePieChart() { this.vmStatisticsAnalysisPie!.config = { appendPadding: 0, data: this.vmStatisticsAnalysisTypeData, @@ -247,7 +253,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { `; }, angleClick: (it) => { - this.vmTypeLevelClickEvent(it, val); + this.vmTypeLevelClickEvent(it); }, hoverHandler: (data) => { if (data) { @@ -262,12 +268,14 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], }; - this.vmStatisticsAnalysisTableType!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let satData = evt.detail.data; + this.vmStatisticsAnalysisTableType!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let vmTypeData = evt.detail; + if (vmTypeData.data) { + let satData = vmTypeData.data; satData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (vmTypeData.callBack) { + vmTypeData.callBack(true); } } this.vmStatisticsAnalysisPie?.showHover(); @@ -285,25 +293,27 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.vmStatisticsAnalysisTableType!.addEventListener('row-click', (evt: any) => { + this.vmStatisticsAnalysisTableType!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.vmTypeLevelClickEvent(data, val); + this.vmTypeLevelClickEvent(data); } }); } - vmTypeLevelClickEvent(it: any, val: any) { + vmTypeLevelClickEvent(it: any) { this.clearData(); this.vmStatisticsAnalysisTableType!.style.display = 'none'; this.vmStatisticsAnalysisTableThread!.style.display = 'grid'; this.vmStatisticsAnalysisTableType!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableThread?.removeAttribute('hideDownload'); - this.getVirtualMemoryThread(it, val); + this.getVirtualMemoryThread(it); this.typeName = it.tableName; this.vmStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName; } - threadPieChart(val: any) { + threadPieChart() { + // @ts-ignore this.sumDur = this.threadStatisticsData.allDuration; this.vmStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -325,7 +335,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.vmThreadLevelClickEvent(it, val); + this.vmThreadLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -341,12 +351,14 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], }; - this.vmStatisticsAnalysisTableThread!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let threadData = evt.detail.data; + this.vmStatisticsAnalysisTableThread!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let vmThreadData = evt.detail; + if (vmThreadData.data) { + let threadData = vmThreadData.data; threadData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (vmThreadData.callBack) { + vmThreadData.callBack(true); } } this.vmStatisticsAnalysisPie?.showHover(); @@ -364,27 +376,29 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.vmStatisticsAnalysisTableThread!.addEventListener('row-click', (evt: any) => { + this.vmStatisticsAnalysisTableThread!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.vmThreadLevelClickEvent(data, val); + this.vmThreadLevelClickEvent(data); } }); } - vmThreadLevelClickEvent(it: any, val: any) { + vmThreadLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.vmStatisticsAnalysisTableThread!.style.display = 'none'; this.vmStatisticsAnalysisTableSo!.style.display = 'grid'; this.vmStatisticsAnalysisTableThread!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableSo?.removeAttribute('hideDownload'); - this.getVirtualMemorySo(it, val); + this.getVirtualMemorySo(it); this.threadName = it.tableName; this.vmStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName + ' / ' + this.threadName; } - libraryPieChart(val: any) { + libraryPieChart() { + // @ts-ignore this.sumDur = this.libStatisticsData.allDuration; this.vmStatisticsAnalysisPie!.config = { appendPadding: 0, @@ -406,7 +420,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.vmSoLevelClickEvent(it, val); + this.vmSoLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -422,12 +436,14 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], }; - this.vmStatisticsAnalysisTableSo!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let soData = evt.detail.data; + this.vmStatisticsAnalysisTableSo!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let vmSoData = evt.detail; + if (vmSoData.data) { + let soData = vmSoData.data; soData.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (vmSoData.callBack) { + vmSoData.callBack(true); } } this.vmStatisticsAnalysisPie?.showHover(); @@ -446,21 +462,22 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.vmStatisticsAnalysisTableSo!.addEventListener('row-click', (evt: any) => { + this.vmStatisticsAnalysisTableSo!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.duration !== 0) { - this.vmSoLevelClickEvent(data, val); + this.vmSoLevelClickEvent(data); } }); } - vmSoLevelClickEvent(it: any, val: any) { + vmSoLevelClickEvent(it: any) { this.clearData(); this.back!.style.visibility = 'visible'; this.vmStatisticsAnalysisTableSo!.style.display = 'none'; this.vmStatisticsAnalysisTableFunction!.style.display = 'grid'; this.vmStatisticsAnalysisTableSo!.setAttribute('hideDownload', ''); this.vmStatisticsAnalysisTableFunction?.removeAttribute('hideDownload'); - this.getVirtualMemoryFunction(it, val); + this.getVirtualMemoryFunction(it); this.vmStatisticsAnalysisPie?.hideTip(); this.shadowRoot!.querySelector('.title')!.textContent = this.processName + ' / ' + this.typeName + ' / ' + this.threadName + ' / ' + it.tableName; @@ -556,23 +573,23 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { vmsCurrentTable!.recycleDataSource = vmsArr; } } - getVirtualMemoryProcess(val: any, result: Array) { + getVirtualMemoryProcess(result: Array) { this.vmStatisticsAnalysisProgressEL!.loading = true; this.vmStatisticsAnalysisProcessData = JSON.parse(JSON.stringify(result)); if (!this.vmStatisticsAnalysisProcessData || this.vmStatisticsAnalysisProcessData.length === 0) { this.vmStatisticsAnalysisPidData = []; this.processStatisticsData = []; - this.processPieChart(val); + this.processPieChart(); return; } let allDur = 0; - let vmMap = new Map>(); + let vmMap = new Map>(); for (let itemData of result) { allDur += itemData.dur; if (vmMap.has(itemData.pid)) { vmMap.get(itemData.pid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); vmMap.set(itemData.pid, itemArray); } @@ -601,20 +618,25 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.processStatisticsData = this.totalDurationData(allDur); this.currentLevel = 0; this.vmStatisticsAnalysisProgressEL!.loading = false; - this.processPieChart(val); + this.processPieChart(); new ResizeObserver(() => { if (this.parentElement?.clientHeight != 0) { - this.vmStatisticsAnalysisTableProcess!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.vmStatisticsAnalysisTableType!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.vmStatisticsAnalysisTableThread!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.vmStatisticsAnalysisTableSo!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.vmStatisticsAnalysisTableFunction!.style.height = this.parentElement!.clientHeight - 40 + 'px'; + this.vmStatisticsAnalysisTableProcess!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.vmStatisticsAnalysisTableProcess?.reMeauseHeight(); + this.vmStatisticsAnalysisTableType!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.vmStatisticsAnalysisTableType?.reMeauseHeight(); + this.vmStatisticsAnalysisTableThread!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.vmStatisticsAnalysisTableThread?.reMeauseHeight(); + this.vmStatisticsAnalysisTableSo!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.vmStatisticsAnalysisTableSo?.reMeauseHeight(); + this.vmStatisticsAnalysisTableFunction!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.vmStatisticsAnalysisTableFunction?.reMeauseHeight(); } }).observe(this.parentElement!); } - getVirtualMemoryType(item: any, val: any) { + getVirtualMemoryType(item: any) { this.vmStatisticsAnalysisProgressEL!.loading = true; - let typeMap = new Map>(); + let typeMap = new Map>(); let pid = item.pid; let allDur = 0; if (!this.vmStatisticsAnalysisProcessData || this.vmStatisticsAnalysisProcessData.length === 0) { @@ -628,13 +650,13 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { if (typeMap.has(vmsItem.type)) { typeMap.get(vmsItem.type)?.push(vmsItem); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(vmsItem); typeMap.set(vmsItem.type, itemArray); } } this.vmStatisticsAnalysisTypeData = []; - typeMap.forEach((value: Array, key: string) => { + typeMap.forEach((value: Array, key: number) => { let dur = 0; for (let item of value) { dur += item.dur; @@ -652,12 +674,12 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.vmStatisticsAnalysisTypeData.sort((a, b) => b.duration - a.duration); this.typeStatisticsData = this.totalDurationData(allDur); this.currentLevel = 1; - this.typePieChart(val); + this.typePieChart(); this.vmStatisticsAnalysisProgressEL!.loading = false; } - getVirtualMemoryThread(item: any, val: any) { + getVirtualMemoryThread(item: any) { this.vmStatisticsAnalysisProgressEL!.loading = true; - let threadMap = new Map>(); + let threadMap = new Map>(); let pid = item.pid; let type = item.type; let allDur = 0; @@ -672,7 +694,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { if (threadMap.has(vmapItem.tid)) { threadMap.get(vmapItem.tid)?.push(vmapItem); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(vmapItem); threadMap.set(vmapItem.tid, itemArray); } @@ -701,15 +723,15 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.threadStatisticsData = this.totalDurationData(allDur); this.currentLevel = 2; this.vmStatisticsAnalysisProgressEL!.loading = false; - this.threadPieChart(val); + this.threadPieChart(); } - getVirtualMemorySo(item: any, val: any) { + getVirtualMemorySo(item: any) { this.vmStatisticsAnalysisProgressEL!.loading = true; let tid = item.tid; let pid = item.pid; let type = item.type; let allDur = 0; - let libMap = new Map>(); + let libMap = new Map>(); if (!this.vmStatisticsAnalysisProcessData || this.vmStatisticsAnalysisProcessData.length === 0) { return; } @@ -721,7 +743,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { if (libMap.has(vmItemData.libId)) { libMap.get(vmItemData.libId)?.push(vmItemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(vmItemData); libMap.set(vmItemData.libId, dataArray); } @@ -757,10 +779,10 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.libStatisticsData = this.totalDurationData(allDur); this.currentLevel = 3; this.vmStatisticsAnalysisProgressEL!.loading = false; - this.libraryPieChart(val); + this.libraryPieChart(); } - getVirtualMemoryFunction(item: any, val: any) { + getVirtualMemoryFunction(item: any) { this.vmStatisticsAnalysisProgressEL!.loading = true; this.shadowRoot!.querySelector('.subheading')!.textContent = 'Statistic By Function AllDuration'; let tid = item.tid; @@ -785,7 +807,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { if (symbolMap.has(vmProcessData.symbolId)) { symbolMap.get(vmProcessData.symbolId)?.push(vmProcessData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(vmProcessData); symbolMap.set(vmProcessData.symbolId, dataArray); } @@ -815,6 +837,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.vmStatisticsAnalysisFunctionData.sort((a, b) => b.duration - a.duration); this.functionStatisticsData = this.totalDurationData(allDur); this.currentLevel = 4; + // @ts-ignore this.sumDur = this.libStatisticsData.allDuration; this.vmStatisticsAnalysisProgressEL!.loading = false; this.vmStatisticsAnalysisPie!.config = { @@ -847,12 +870,14 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { }, ], }; - this.vmStatisticsAnalysisTableFunction!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let data = evt.detail.data; + this.vmStatisticsAnalysisTableFunction!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let vmFunctionData = evt.detail; + if (vmFunctionData.data) { + let data = vmFunctionData.data; data.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (vmFunctionData.callBack) { + vmFunctionData.callBack(true); } } this.vmStatisticsAnalysisPie?.showHover(); @@ -869,16 +894,17 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { this.sortByColumn(evt.detail.key, evt.detail.sort); }); } - typeIdToString(type: any) { - let releaseType: any; + typeIdToString(type: number) { + let releaseType: string; if (type === 1) { releaseType = 'File Backed In'; } else if (type === 7) { releaseType = 'Copy On Writer'; } + // @ts-ignore return releaseType; } - totalDurationData(duration: any) { + totalDurationData(duration: number) { let allDuration; allDuration = { durFormat: Utils.getProbablyTime(duration), @@ -890,7 +916,7 @@ export class TabPaneVirtualMemoryStatisticsAnalysis extends BaseElement { } getPieChartData(vmRes: any[]) { if (vmRes.length > 20) { - let pieChartArr: any[] = []; + let pieChartArr: string[] = []; let other: any = { tableName: 'other', duration: 0, diff --git a/ide/src/trace/component/trace/sheet/hiperf/TabPanePerfAnalysis.ts b/ide/src/trace/component/trace/sheet/hiperf/TabPanePerfAnalysis.ts index be7cb095..87992482 100644 --- a/ide/src/trace/component/trace/sheet/hiperf/TabPanePerfAnalysis.ts +++ b/ide/src/trace/component/trace/sheet/hiperf/TabPanePerfAnalysis.ts @@ -18,8 +18,6 @@ import { LitTable } from '../../../../../base-ui/table/lit-table.js'; import { SelectionParam } from '../../../../bean/BoxSelection.js'; import { LitChartPie } from '../../../../../base-ui/chart/pie/LitChartPie.js'; import '../../../../../base-ui/chart/pie/LitChartPie.js'; -import { queryPerfProcess } from '../../../../database/SqlLite.js'; -import { PerfThread } from '../../../../bean/PerfProfile.js'; import { LitProgressBar } from '../../../../../base-ui/progress-bar/LitProgressBar.js'; import { procedurePool } from '../../../../database/Procedure.js'; import { Utils } from '../../base/Utils.js'; @@ -37,23 +35,23 @@ export class TabPanePerfAnalysis extends BaseElement { private tableProcess: LitTable | null | undefined; private tableSo: LitTable | null | undefined; private tableFunction: LitTable | null | undefined; - private sumCount: any; + private sumCount: number | undefined | null; private perfAnalysisRange: HTMLLabelElement | null | undefined; private back: HTMLDivElement | null | undefined; private tabName: HTMLDivElement | null | undefined; private progressEL: LitProgressBar | null | undefined; - private processName: any; - private threadName: any; + private processName: HTMLDivElement | null | undefined; + private threadName: HTMLDivElement | null | undefined; private callChainMap!: Map; private sortColumn: string = ''; private sortType: number = 0; - private allProcessCount!: any; - private allThreadCount!: any; - private allLibCount!: any; - private allSymbolCount!: any; + private allProcessCount!: {}; + private allThreadCount!: {}; + private allLibCount!: {}; + private allSymbolCount!: {}; private currentLevel = -1; private currentLevelData!: Array; - set data(val: SelectionParam | any) { + set data(val: SelectionParam) { if (val === this.currentSelection) { this.pidData.unshift(this.allProcessCount); this.tableProcess!.recycleDataSource = this.pidData; @@ -68,6 +66,8 @@ export class TabPanePerfAnalysis extends BaseElement { this.tableSo!.style.display = 'none'; this.tableFunction!.style.display = 'none'; this.back!.style.visibility = 'hidden'; + this.shadowRoot!.querySelector('.title')!.textContent = ''; + this.tabName!.textContent = ''; this.perfAnalysisRange!.textContent = 'Selected range: ' + parseFloat(((val.rightNs - val.leftNs) / 1000000.0).toFixed(5)) + ' ms'; if (!this.callChainMap) { @@ -125,7 +125,8 @@ export class TabPanePerfAnalysis extends BaseElement { } }); } - processPieChart(val: any) { + processPieChart(val: SelectionParam) { + // @ts-ignore this.sumCount = this.allProcessCount.allCount; this.perfAnalysisPie!.config = { appendPadding: 0, @@ -163,12 +164,14 @@ export class TabPanePerfAnalysis extends BaseElement { }, ], }; - this.tableProcess!.addEventListener('row-hover', (tblProcessRowHover: any) => { - if (tblProcessRowHover.detail.data) { - let data = tblProcessRowHover.detail.data; + this.tableProcess!.addEventListener('row-hover', (tblProcessRowHover) => { + // @ts-ignore + let tblProcessData = tblProcessRowHover.detail; + if (tblProcessData.data) { + let data = tblProcessData.data; data.isHover = true; - if ((tblProcessRowHover.detail as any).callBack) { - (tblProcessRowHover.detail as any).callBack(true); + if (tblProcessData.callBack) { + tblProcessData.callBack(true); } } this.perfAnalysisPie?.showHover(); @@ -186,14 +189,15 @@ export class TabPanePerfAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableProcess!.addEventListener('row-click', (evt: any) => { + this.tableProcess!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.count !== 0) { this.perfProcessLevelClickEvent(data, val); } }); } - perfProcessLevelClickEvent(it: any, val: any) { + perfProcessLevelClickEvent(it: any, val: SelectionParam) { this.clearData(); this.back!.style.visibility = 'visible'; this.tableProcess!.style.display = 'none'; @@ -207,14 +211,16 @@ export class TabPanePerfAnalysis extends BaseElement { this.processName = it.tableName; this.perfAnalysisPie?.hideTip(); } - threadPieChart(val: any) { + threadPieChart(val: SelectionParam) { if (val.perfThread.length > 0 && val.perfProcess.length === 0) { this.back!.style.visibility = 'hidden'; this.shadowRoot!.querySelector('.title')!.textContent = ''; this.perfTableThread!.style.display = 'grid'; } else { + // @ts-ignore this.shadowRoot!.querySelector('.title')!.textContent = this.processName; } + // @ts-ignore this.sumCount = this.allThreadCount.allCount; this.perfAnalysisPie!.config = { appendPadding: 0, @@ -252,12 +258,14 @@ export class TabPanePerfAnalysis extends BaseElement { }, ], }; - this.perfTableThread!.addEventListener('row-hover', (perfTblThreadRowHover: any) => { - if (perfTblThreadRowHover.detail.data) { - let data = perfTblThreadRowHover.detail.data; + this.perfTableThread!.addEventListener('row-hover', (perfTblThreadRowHover) => { + // @ts-ignore + let perfTblThreadData = perfTblThreadRowHover.detail; + if (perfTblThreadData.data) { + let data = perfTblThreadData.data; data.isHover = true; - if ((perfTblThreadRowHover.detail as any).callBack) { - (perfTblThreadRowHover.detail as any).callBack(true); + if (perfTblThreadData.callBack) { + perfTblThreadData.callBack(true); } } this.perfAnalysisPie?.showHover(); @@ -274,14 +282,15 @@ export class TabPanePerfAnalysis extends BaseElement { // @ts-ignore this.threadData.shift(this.allThreadCount); this.currentLevelData = this.threadData; - this.perfTableThread!.addEventListener('row-click', (evt: any) => { + this.perfTableThread!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.count !== 0) { this.perfThreadLevelClickEvent(data, val); } }); } - perfThreadLevelClickEvent(it: any, val: any) { + perfThreadLevelClickEvent(it: any, val: SelectionParam) { this.clearData(); this.back!.style.visibility = 'visible'; this.perfTableThread!.style.display = 'none'; @@ -296,7 +305,8 @@ export class TabPanePerfAnalysis extends BaseElement { this.threadName = it.tableName; this.perfAnalysisPie?.hideTip(); } - libraryPieChart(val: any) { + libraryPieChart(val: SelectionParam) { + // @ts-ignore this.sumCount = this.allLibCount.allCount; this.perfAnalysisPie!.config = { appendPadding: 0, @@ -334,12 +344,14 @@ export class TabPanePerfAnalysis extends BaseElement { }, ], }; - this.tableSo!.addEventListener('row-hover', (tableSoRowHover: any) => { - if (tableSoRowHover.detail.data) { - let data = tableSoRowHover.detail.data; + this.tableSo!.addEventListener('row-hover', (tableSoRowHover) => { + // @ts-ignore + let tableSoData = tableSoRowHover.detail; + if (tableSoData.data) { + let data = tableSoData.data; data.isHover = true; - if ((tableSoRowHover.detail as any).callBack) { - (tableSoRowHover.detail as any).callBack(true); + if (tableSoData.callBack) { + tableSoData.callBack(true); } } this.perfAnalysisPie?.showHover(); @@ -357,20 +369,21 @@ export class TabPanePerfAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableSo!.addEventListener('row-click', (evt: any) => { + this.tableSo!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.count !== 0) { this.perfSoLevelClickEvent(data, val); } }); } - perfSoLevelClickEvent(it: any, val: any) { + perfSoLevelClickEvent(it: any, val: SelectionParam) { this.clearData(); this.tableSo!.style.display = 'none'; this.tableFunction!.style.display = 'grid'; this.tableSo!.setAttribute('hideDownload', ''); this.tableFunction?.removeAttribute('hideDownload'); - this.getHiperfFunction(it, val); + this.getHiperfFunction(it); this.shadowRoot!.querySelector('.title')!.textContent = // @ts-ignore this.processName + ' / ' + this.threadName + ' / ' + it.tableName; @@ -458,7 +471,7 @@ export class TabPanePerfAnalysis extends BaseElement { currentTable!.recycleDataSource = arr; } } - async getHiperfProcess(val: any) { + async getHiperfProcess(val: SelectionParam) { this.progressEL!.loading = true; if (!this.processData || this.processData.length === 0) { this.progressEL!.loading = false; @@ -475,7 +488,7 @@ export class TabPanePerfAnalysis extends BaseElement { return; } let allCount = 0; - let pidMap = new Map>(); + let pidMap = new Map>(); if (val.perfThread.length > 0 && val.perfProcess.length === 0) { this.tableProcess!.style.display = 'none'; this.getHiperfThread(this.processData[0], val); @@ -485,7 +498,7 @@ export class TabPanePerfAnalysis extends BaseElement { if (pidMap.has(itemData.pid)) { pidMap.get(itemData.pid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); pidMap.set(itemData.pid, itemArray); } @@ -514,16 +527,20 @@ export class TabPanePerfAnalysis extends BaseElement { } new ResizeObserver(() => { if (this.parentElement?.clientHeight != 0) { - this.tableProcess!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.perfTableThread!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableFunction!.style.height = this.parentElement!.clientHeight - 30 + 'px'; - this.tableSo!.style.height = this.parentElement!.clientHeight - 30 + 'px'; + this.tableProcess!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableProcess?.reMeauseHeight(); + this.perfTableThread!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.perfTableThread?.reMeauseHeight(); + this.tableFunction!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableFunction?.reMeauseHeight(); + this.tableSo!.style.height = this.parentElement!.clientHeight - 50 + 'px'; + this.tableSo?.reMeauseHeight(); } }).observe(this.parentElement!); } - getHiperfThread(item: any, val: any) { + getHiperfThread(item: any, val: SelectionParam) { this.progressEL!.loading = true; - let threadMap = new Map>(); + let threadMap = new Map>(); let pid = item.pid; let allCount = 0; if (!this.processData || this.processData.length === 0) { @@ -537,7 +554,7 @@ export class TabPanePerfAnalysis extends BaseElement { if (threadMap.has(itemData.tid)) { threadMap.get(itemData.tid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); threadMap.set(itemData.tid, itemArray); } @@ -565,13 +582,13 @@ export class TabPanePerfAnalysis extends BaseElement { this.progressEL!.loading = false; this.threadPieChart(val); } - getHiperfSo(item: any, val: any) { + getHiperfSo(item: any, val: SelectionParam) { this.progressEL!.loading = true; let parentCount = item.count; let tid = item.tid; let pid = item.pid; let allCount = 0; - let libMap = new Map>(); + let libMap = new Map>(); if (!this.processData || this.processData.length === 0) { return; } @@ -583,7 +600,7 @@ export class TabPanePerfAnalysis extends BaseElement { if (libMap.has(itemData.libId)) { libMap.get(itemData.libId)?.push(itemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(itemData); libMap.set(itemData.libId, dataArray); } @@ -612,7 +629,7 @@ export class TabPanePerfAnalysis extends BaseElement { this.progressEL!.loading = false; this.libraryPieChart(val); } - getHiperfFunction(item: any, val: any) { + getHiperfFunction(item: any) { this.progressEL!.loading = true; this.shadowRoot!.querySelector('.subheading')!.textContent = 'Statistic By Function Count'; let parentCount = item.count; @@ -632,7 +649,7 @@ export class TabPanePerfAnalysis extends BaseElement { if (symbolMap.has(itemData.symbolId)) { symbolMap.get(itemData.symbolId)?.push(itemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(itemData); symbolMap.set(itemData.symbolId, dataArray); } @@ -658,6 +675,7 @@ export class TabPanePerfAnalysis extends BaseElement { this.allSymbolCount = this.totalCountData(allCount); this.currentLevel = 3; this.progressEL!.loading = false; + // @ts-ignore this.sumCount = this.allSymbolCount.allCount; this.perfAnalysisPie!.config = { appendPadding: 0, @@ -688,12 +706,14 @@ export class TabPanePerfAnalysis extends BaseElement { }, ], }; - this.tableFunction!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let data = evt.detail.data; + this.tableFunction!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let functionData = evt.detail; + if (functionData.data) { + let data = functionData.data; data.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (functionData.callBack) { + functionData.callBack(true); } } this.perfAnalysisPie?.showHover(); @@ -710,7 +730,7 @@ export class TabPanePerfAnalysis extends BaseElement { this.sortByColumn(evt.detail.key, evt.detail.sort); }); } - totalCountData(count: any) { + totalCountData(count: number) { let allCount; allCount = { countFormat: Utils.timeMsFormat2p(count), @@ -724,7 +744,7 @@ export class TabPanePerfAnalysis extends BaseElement { getPieChartData(res: any[]) { if (res.length > 20) { - let pieChartArr: any[] = []; + let pieChartArr: string[] = []; let other: any = { tableName: 'other', count: 0, @@ -737,6 +757,7 @@ export class TabPanePerfAnalysis extends BaseElement { } else { other.count += res[i].count; other.countFormat = Utils.timeMsFormat2p(other.count); + // @ts-ignore other.percent = ((other.count / this.sumCount) * 100).toFixed(2); } } @@ -745,13 +766,13 @@ export class TabPanePerfAnalysis extends BaseElement { } return res; } - getCallChainDataFromWorker(val: any) { + getCallChainDataFromWorker(val: SelectionParam) { this.getDataByWorker(val, (results: any) => { this.processData = results; this.getHiperfProcess(val); }); } - getDataByWorker(val: any, handler: Function) { + getDataByWorker(val: SelectionParam, handler: Function) { this.progressEL!.loading = true; const args = [ { diff --git a/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMStatisticAnalysis.ts b/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMStatisticAnalysis.ts index 5c992a06..76feb0f4 100644 --- a/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMStatisticAnalysis.ts +++ b/ide/src/trace/component/trace/sheet/native-memory/TabPaneNMStatisticAnalysis.ts @@ -81,13 +81,13 @@ class SizeObj { @element('tabpane-nm-statistic-analysis') export class TabPaneNMStatisticAnalysis extends BaseElement { - private currentSelection: SelectionParam | any; + private currentSelection: SelectionParam | null | undefined; private pie: LitChartPie | null | undefined; private processData!: Array; - private eventTypeData!: any[]; - private threadData!: any[]; - private soData!: any[]; - private functionData!: any[]; + private eventTypeData!: Array; + private threadData!: Array; + private soData!: Array; + private functionData!: Array; private tableType: LitTable | null | undefined; private threadUsageTbl: LitTable | null | undefined; private soUsageTbl: LitTable | null | undefined; @@ -108,14 +108,14 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { private currentLevelApplyCount = 0; private currentLevelReleaseCount = 0; private currentLevelExistCount = 0; - private releaseLibMap!: Map; private currentLevelData!: Array; private typeStatisticsData!: {}; private libStatisticsData!: {}; private functionStatisticsData!: {}; - set data(statisticAnalysisParam: SelectionParam | any) { + set data(statisticAnalysisParam: SelectionParam) { if (statisticAnalysisParam === this.currentSelection) { + // @ts-ignore this.eventTypeData.unshift(this.typeStatisticsData); this.tableType!.recycleDataSource = this.eventTypeData; // @ts-ignore @@ -135,6 +135,8 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.soUsageTbl!.style.display = 'none'; this.functionUsageTbl!.style.display = 'none'; this.back!.style.visibility = 'hidden'; + this.shadowRoot!.querySelector('.title')!.textContent = ''; + this.tabName!.textContent = ''; this.range!.textContent = 'Selected range: ' + parseFloat(((statisticAnalysisParam.rightNs - statisticAnalysisParam.leftNs) / 1000000.0).toFixed(5)) + @@ -172,7 +174,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.tableType?.removeAttribute('hideDownload'); this.currentLevel = 0; this.currentLevelData = this.eventTypeData; - this.typePieChart(this.currentSelection); + this.typePieChart(); } else if (this.tabName!.textContent === 'Statistic By Function Existing') { this.soUsageTbl!.style.display = 'grid'; this.functionUsageTbl!.style.display = 'none'; @@ -180,11 +182,11 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.soUsageTbl?.removeAttribute('hideDownload'); this.currentLevelData = this.soData; this.currentLevel = 1; - this.libraryPieChart(this.currentSelection); + this.libraryPieChart(); } }); } - typePieChart(val: any) { + typePieChart() { this.pie!.config = { appendPadding: 0, data: this.getPieChartData(this.eventTypeData), @@ -205,9 +207,10 @@ export class TabPaneNMStatisticAnalysis extends BaseElement {
# Transient:${typeTipValue.obj.releaseCount} (${typeTipValue.obj.releaseCountPercent}%)
`; }, - angleClick: (it: any) => { + angleClick: (it) => { + // @ts-ignore if (it.tableName != 'other') { - this.nativeProcessLevelClickEvent(it, val); + this.nativeProcessLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -223,12 +226,14 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { }, ], }; - this.tableType!.addEventListener('row-hover', (nmStatAnalysisTblRowHover: any) => { - if (nmStatAnalysisTblRowHover.detail.data) { - let data = nmStatAnalysisTblRowHover.detail.data; + this.tableType!.addEventListener('row-hover', (nmStatAnalysisTblRowHover) => { + // @ts-ignore + let nmStatAnalysisTblData = nmStatAnalysisTblRowHover.detail; + if (nmStatAnalysisTblData.data) { + let data = nmStatAnalysisTblData.data; data.isHover = true; - if ((nmStatAnalysisTblRowHover.detail as any).callBack) { - (nmStatAnalysisTblRowHover.detail as any).callBack(true); + if (nmStatAnalysisTblData.callBack) { + nmStatAnalysisTblData.callBack(true); } } this.pie?.showHover(); @@ -236,6 +241,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { }); this.shadowRoot!.querySelector('.title')!.textContent = ''; this.tabName!.textContent = 'Statistic By Event Type Existing'; + // @ts-ignore this.eventTypeData.unshift(this.typeStatisticsData); this.tableType!.recycleDataSource = this.eventTypeData; this.tableType?.reMeauseHeight(); @@ -243,19 +249,21 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.eventTypeData.shift(this.typeStatisticsData); this.currentLevelData = this.eventTypeData; } - nativeProcessLevelClickEvent(it: any, val: any) { + nativeProcessLevelClickEvent(it: object) { this.clearData(); this.back!.style.visibility = 'visible'; this.tableType!.style.display = 'none'; this.soUsageTbl!.style.display = 'grid'; this.tableType!.setAttribute('hideDownload', ''); this.soUsageTbl?.removeAttribute('hideDownload'); - this.getLibSize(it, val); + this.getLibSize(it); + // @ts-ignore this.shadowRoot!.querySelector('.title')!.textContent = it.typeName; + // @ts-ignore this.type = it.typeName; this.pie?.hideTip(); } - threadPieChart(val: any) { + threadPieChart() { this.pie!.config = { appendPadding: 0, data: this.getPieChartData(this.threadData), @@ -276,13 +284,13 @@ export class TabPaneNMStatisticAnalysis extends BaseElement {
# Transient:${threadTipValue.obj.releaseCount} (${threadTipValue.obj.releaseCountPercent}%)
`; }, - angleClick: (it: any) => { + angleClick: (it) => { // @ts-ignore if (it.tid != 'other') { this.clearData(); this.threadUsageTbl!.style.display = 'none'; this.soUsageTbl!.style.display = 'grid'; - this.getLibSize(it, val); + this.getLibSize(it); // @ts-ignore this.shadowRoot!.querySelector('.title')!.textContent = it.type + ' / ' + 'Thread ' + it.tid; // @ts-ignore @@ -303,12 +311,14 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { }, ], }; - this.threadUsageTbl!.addEventListener('row-hover', (nmStatAnalysisThreadRowHover: any) => { - if (nmStatAnalysisThreadRowHover.detail.data) { - let data = nmStatAnalysisThreadRowHover.detail.data; + this.threadUsageTbl!.addEventListener('row-hover', (nmStatAnalysisThreadRowHover) => { + // @ts-ignore + let nmStatAnalysisThreadData = nmStatAnalysisThreadRowHover.detail; + if (nmStatAnalysisThreadData.data) { + let data = nmStatAnalysisThreadData.data; data.isHover = true; - if ((nmStatAnalysisThreadRowHover.detail as any).callBack) { - (nmStatAnalysisThreadRowHover.detail as any).callBack(true); + if (nmStatAnalysisThreadData.callBack) { + nmStatAnalysisThreadData.callBack(true); } } this.pie?.showHover(); @@ -319,7 +329,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.threadUsageTbl!.recycleDataSource = this.threadData; this.threadUsageTbl?.reMeauseHeight(); } - libraryPieChart(val: any) { + libraryPieChart() { this.pie!.config = { appendPadding: 0, data: this.getPieChartData(this.soData), @@ -340,10 +350,10 @@ export class TabPaneNMStatisticAnalysis extends BaseElement {
# Transient:${libraryTipValue.obj.releaseCount} (${libraryTipValue.obj.releaseCountPercent}%)
`; }, - angleClick: (it: any) => { + angleClick: (it) => { // @ts-ignore if (it.tableName != 'other') { - this.nativeSoLevelClickEvent(it, val); + this.nativeSoLevelClickEvent(it); } }, hoverHandler: (data) => { @@ -360,18 +370,21 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { ], }; this.shadowRoot!.querySelector('.title')!.textContent = this.type + ''; - this.soUsageTbl!.addEventListener('row-hover', (nmStatAnalysisUsageRowHover: any) => { - if (nmStatAnalysisUsageRowHover.detail.data) { - let data = nmStatAnalysisUsageRowHover.detail.data; + this.soUsageTbl!.addEventListener('row-hover', (nmStatAnalysisUsageRowHover) => { + // @ts-ignore + let nmStatAnalysisUsageData = nmStatAnalysisUsageRowHover.detail; + if (nmStatAnalysisUsageData.data) { + let data = nmStatAnalysisUsageData.data; data.isHover = true; - if ((nmStatAnalysisUsageRowHover.detail as any).callBack) { - (nmStatAnalysisUsageRowHover.detail as any).callBack(true); + if (nmStatAnalysisUsageData.callBack) { + nmStatAnalysisUsageData.callBack(true); } } this.pie?.showHover(); this.pie?.hideTip(); }); this.tabName!.textContent = 'Statistic By Library Existing'; + // @ts-ignore this.soData.unshift(this.libStatisticsData); this.soUsageTbl!.recycleDataSource = this.soData; // @ts-ignore @@ -382,24 +395,26 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.soUsageTbl!.addEventListener('row-click', (evt: any) => { + this.soUsageTbl!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.existSize !== 0) { - this.nativeSoLevelClickEvent(data, val); + this.nativeSoLevelClickEvent(data); } }); } - nativeSoLevelClickEvent(it: any, val: any) { + nativeSoLevelClickEvent(it: object) { this.clearData(); this.soUsageTbl!.style.display = 'none'; this.functionUsageTbl!.style.display = 'grid'; this.soUsageTbl!.setAttribute('hideDownload', ''); this.functionUsageTbl?.removeAttribute('hideDownload'); - this.getNMFunctionSize(it, val); + this.getNMFunctionSize(it); + // @ts-ignore this.shadowRoot!.querySelector('.title')!.textContent = this.type + ' / ' + it.libName; this.pie?.hideTip(); } - functionPieChart(val: any) { + functionPieChart() { this.pie!.config = { appendPadding: 0, data: this.getPieChartData(this.functionData), @@ -433,17 +448,20 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { }, ], }; - this.functionUsageTbl!.addEventListener('row-hover', (evt: any) => { - if (evt.detail.data) { - let data = evt.detail.data; + this.functionUsageTbl!.addEventListener('row-hover', (evt) => { + // @ts-ignore + let functionAnalysisData = evt.detail; + if (functionAnalysisData.data) { + let data = functionAnalysisData.data; data.isHover = true; - if ((evt.detail as any).callBack) { - (evt.detail as any).callBack(true); + if (functionAnalysisData.callBack) { + functionAnalysisData.callBack(true); } } this.pie?.showHover(); this.pie?.hideTip(); }); + // @ts-ignore this.functionData.unshift(this.functionStatisticsData); this.functionUsageTbl!.recycleDataSource = this.functionData; // @ts-ignore @@ -576,7 +594,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } } - getNMEventTypeSize(val: any) { + getNMEventTypeSize(val: SelectionParam) { this.progressEL!.loading = true; let typeFilter = []; if (this.isStatistic) { @@ -610,30 +628,31 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); - this.tableType!.addEventListener('row-click', (evt: any) => { + this.tableType!.addEventListener('row-click', (evt) => { + // @ts-ignore let data = evt.detail.data; if (data.tableName !== '' && data.existSize !== 0) { - this.nativeProcessLevelClickEvent(data, val); + this.nativeProcessLevelClickEvent(data); } }); new ResizeObserver(() => { // @ts-ignore if (this.parentElement?.clientHeight != 0) { // @ts-ignore - this.tableType?.shadowRoot?.querySelector('.table').style.height = this.parentElement.clientHeight - 30 + 'px'; + this.tableType?.shadowRoot?.querySelector('.table').style.height = this.parentElement.clientHeight - 40 + 'px'; this.tableType?.reMeauseHeight(); // @ts-ignore - this.soUsageTbl?.shadowRoot?.querySelector('.table').style.height = this.parentElement.clientHeight - 30 + 'px'; + this.soUsageTbl?.shadowRoot?.querySelector('.table').style.height = this.parentElement.clientHeight - 40 + 'px'; this.soUsageTbl?.reMeauseHeight(); // @ts-ignore this.functionUsageTbl?.shadowRoot?.querySelector('.table').style.height = - this.parentElement!.clientHeight - 30 + 'px'; + this.parentElement!.clientHeight - 40 + 'px'; this.functionUsageTbl?.reMeauseHeight(); } }).observe(this.parentElement!); } - private calTypeSize(val: any, result: any) { + private calTypeSize(val: SelectionParam, result: any) { this.processData = JSON.parse(JSON.stringify(result)); this.resetCurrentLevelData(); this.typeMap = this.typeSizeGroup(this.processData); @@ -648,13 +667,13 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } } if (this.typeMap.has(TYPE_MAP)) { - let subTypeMap = new Map>(); + let subTypeMap = new Map>(); for (let item of this.typeMap.get(TYPE_MAP)!) { if (item.subType) { if (subTypeMap.has(item.subType)) { subTypeMap.get(item.subType)?.push(item); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(item); subTypeMap.set(item.subType, dataArray); } @@ -662,13 +681,13 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { if (subTypeMap.has(TYPE_MAP_STRING)) { subTypeMap.get(TYPE_MAP_STRING)?.push(item); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(item); subTypeMap.set(TYPE_MAP_STRING, dataArray); } } } - subTypeMap.forEach((arr: Array, subType: any) => { + subTypeMap.forEach((arr: Array, subType: string) => { let mapType = this.setTypeMap(this.typeMap, TYPE_MAP, subType); if (mapType) { this.calPercent(mapType); @@ -680,12 +699,12 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.typeStatisticsData = this.totalData(this.typeStatisticsData); this.progressEL!.loading = false; this.currentLevel = 0; - this.typePieChart(val); + this.typePieChart(); } - getNMThreadSize(item: any, val: any) { + getNMThreadSize(item: any, val: SelectionParam) { this.progressEL!.loading = true; - let threadMap = new Map>(); + let threadMap = new Map>(); let types = this.getTypes(item); this.resetCurrentLevelData(item); @@ -697,13 +716,13 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { if (threadMap.has(itemData.tid)) { threadMap.get(itemData.tid)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); threadMap.set(itemData.tid, itemArray); } } this.threadData = []; - threadMap.forEach((dbData: Array, tid: number) => { + threadMap.forEach((dbData: Array, tid: number) => { const sizeObj = this.calSizeObj(dbData); let analysis = new AnalysisObj(sizeObj.applySize, sizeObj.applyCount, sizeObj.releaseSize, sizeObj.releaseCount); this.calPercent(analysis); @@ -717,19 +736,19 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.threadData.sort((a, b) => b.existSize - a.existSize); this.currentLevelData = this.threadData; this.progressEL!.loading = false; - this.threadPieChart(val); + this.threadPieChart(); this.threadUsageTbl!.addEventListener('column-click', (evt) => { // @ts-ignore this.sortByColumn(evt.detail.key, evt.detail.sort); }); } - getLibSize(item: any, val: any) { + getLibSize(item: any) { this.progressEL!.loading = true; let typeId = item.typeId; let typeName = item.typeName; let tid = item.tid; - let libMap = new Map>(); + let libMap = new Map>(); this.resetCurrentLevelData(item); let types = this.getTypes(item); this.soData = []; @@ -775,7 +794,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { if (libMap.has(libId)) { libMap.get(libId)?.push(itemData); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(itemData); libMap.set(libId, dataArray); } @@ -801,18 +820,18 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.soData.sort((a, b) => b.existSize - a.existSize); this.libStatisticsData = this.totalData(this.libStatisticsData); this.currentLevel = 1; - this.libraryPieChart(val); + this.libraryPieChart(); this.progressEL!.loading = false; } - getNMFunctionSize(item: any, val: any) { + getNMFunctionSize(item: any) { this.progressEL!.loading = true; this.shadowRoot!.querySelector('.subheading')!.textContent = 'Statistic By Function Existing'; let typeId = item.typeId; let typeName = item.typeName; let tid = item.tid; let libId = item.libId; - let symbolMap = new Map>(); + let symbolMap = new Map>(); this.resetCurrentLevelData(item); let types = this.getTypes(item); if (!this.processData) { @@ -857,7 +876,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { if (symbolMap.has(data.symbolId)) { symbolMap.get(data.symbolId)?.push(data); } else { - let dataArray = new Array(); + let dataArray = new Array(); dataArray.push(data); symbolMap.set(data.symbolId, dataArray); } @@ -886,12 +905,12 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { this.functionStatisticsData = this.totalData(this.functionStatisticsData); this.currentLevel = 2; this.progressEL!.loading = false; - this.functionPieChart(val); + this.functionPieChart(); } getPieChartData(res: any[]) { if (res.length > PIE_CHART_LIMIT) { - let pieChartArr: any[] = []; + let pieChartArr: string[] = []; let other: any = { tableName: 'other', symbolName: 'other', @@ -900,8 +919,17 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { existSize: 0, existSizeFormat: '', existCount: 0, - countPercent: 'other', existCountPercent: 0, + applySizeFormat: '', + applySize: 0, + applySizePercent: 0, + applyCount: 0, + applyCountPercent: 0, + releaseSizeFormat: '', + releaseSize: 0, + releaseSizePercent: 0, + releaseCount: 0, + releaseCountPercent: 0, }; for (let i = 0; i < res.length; i++) { if (i < PIE_CHART_LIMIT - 1) { @@ -909,9 +937,19 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } else { other.existCount += res[i].existCount; other.existSize += res[i].existSize; + other.applySize += res[i].applySize; + other.applyCount += res[i].applyCount; + other.releaseSize += res[i].releaseSize; + other.releaseCount += res[i].releaseCount; other.existSizeFormat = Utils.getBinaryByteWithUnit(other.existSize); + other.applySizeFormat = Utils.getBinaryByteWithUnit(other.applySize); + other.releaseSizeFormat = Utils.getBinaryByteWithUnit(other.releaseSize); other.existSizePercent = ((other.existSize / this.currentLevelExistSize) * 100).toFixed(2); other.existCountPercent = ((other.existCount / this.currentLevelExistCount) * 100).toFixed(2); + other.applySizePercent = ((other.applySize / this.currentLevelApplySize) * 100).toFixed(2); + other.applyCountPercent = ((other.applyCount / this.currentLevelApplyCount) * 100).toFixed(2); + other.releaseSizePercent = ((other.releaseSize / this.currentLevelReleaseSize) * 100).toFixed(2); + other.releaseCountPercent = ((other.releaseCount / this.currentLevelReleaseCount) * 100).toFixed(2); } } pieChartArr.push(other); @@ -1009,8 +1047,8 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } } - private typeSizeGroup(dbArray: Array): Map> { - let typeMap = new Map>(); + private typeSizeGroup(dbArray: Array): Map> { + let typeMap = new Map>(); if (!dbArray || dbArray.length === 0) { return typeMap; } @@ -1031,13 +1069,14 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } for (let itemData of dbArray) { + // @ts-ignore switch (itemData.type) { case TYPE_ALLOC: setSize(itemData); if (typeMap.has(TYPE_ALLOC)) { typeMap.get(TYPE_ALLOC)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); typeMap.set(TYPE_ALLOC, itemArray); } @@ -1047,7 +1086,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { if (typeMap.has(TYPE_MAP)) { typeMap.get(TYPE_MAP)?.push(itemData); } else { - let itemArray = new Array(); + let itemArray = new Array(); itemArray.push(itemData); typeMap.set(TYPE_MAP, itemArray); } @@ -1057,7 +1096,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { return typeMap; } - totalData(total: any) { + totalData(total: {}) { total = { existSizeFormat: Utils.getBinaryByteWithUnit(this.currentLevelExistSize), existSizePercent: ((this.currentLevelExistSize / this.currentLevelExistSize) * 100).toFixed(2), @@ -1101,7 +1140,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { } getTypes(parent: AnalysisObj) { - let types = new Array(); + let types = new Array(); types.push(parent.typeId!); types.push(parent.typeName!); if (!this.isStatistic) { @@ -1116,7 +1155,7 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { return types; } - getDataFromWorker(val: SelectionParam | any, typeFilter: Array) { + getDataFromWorker(val: SelectionParam, typeFilter: Array) { this.getDataByWorkerQuery( { leftNs: val.leftNs, @@ -1202,17 +1241,17 @@ export class TabPaneNMStatisticAnalysis extends BaseElement { - + - + - + - + - + - +