diff --git a/ide/src/base-ui/checkbox/LitCheckBox.ts b/ide/src/base-ui/checkbox/LitCheckBox.ts index dcb5693a84b509be714d83ee8a82442b81b4106c..cacb1cdfb46467ef15272ca0c0262aac71c5b5f0 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 985f1d01159d8b5177b92d1f4d541f0c081c2546..28d1dded6c73574fe769a0d79efafc5356f86aab 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 59daef7e233b463a4c6b07dafbe5dcf3bfdd6516..cbade4cd0334b41e4ebadc8810299a15c003b1c6 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 2355109c8ba05ae212c4a0ee1a92fd493515badc..98f214e2c9f75e50949943a3289b20aa5b8947b2 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 b15711fedec3e3311d12a5e8ef9d8e13e545a916..1b7dacac5d82f281a93565a01444bdc57d5414af 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 3662a1d65c424dd50f06bc0a99cfecf65a434072..428875a4be8b7e3ebdc27bbccca509a5dda0e891 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 c4f815ed6827dda36e3d08448fcb2284aa9250fb..64eb5f5aa814dc8f6cc4851d9f3fe0a942343c26 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 +412,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 +577,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 +587,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 +827,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 +882,7 @@ export class SpApplication extends BaseElement {
                 mainMenu.menus = mainMenu.menus!;
               }
               spInfoAndStats.initInfoAndStatsData();
+              reader = null;
             }
           );
         };
@@ -1251,7 +1256,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 != '') {
diff --git a/ide/src/trace/bean/JankFramesStruct.ts b/ide/src/trace/bean/JankFramesStruct.ts
index f539d0a664131bf53c9219771f5e39e0d942262b..d5155b4e1aeeaae703f740f984cec43298e00f06 100644
--- a/ide/src/trace/bean/JankFramesStruct.ts
+++ b/ide/src/trace/bean/JankFramesStruct.ts
@@ -22,5 +22,5 @@ export class JankFramesStruct {
   meanDuration: number = -1;
   meanDurationStr: string = '';
   occurrences: number = 0;
-  flag: boolean = false;
+  flag: number | undefined = 0;
 }
diff --git a/ide/src/trace/bean/JanksStruct.ts b/ide/src/trace/bean/JanksStruct.ts
index e905dfd430b1a8e140261433dcf0300595b2d79d..f0367b201a7af0572e97df035b3029d86fe23916 100644
--- a/ide/src/trace/bean/JanksStruct.ts
+++ b/ide/src/trace/bean/JanksStruct.ts
@@ -25,7 +25,7 @@ export class JanksStruct extends BaseStruct {
   dur: number | undefined;
   name: string | undefined;
   depth: number | undefined;
-  jank_tag: boolean = false;
+  jank_tag: number | undefined;
   cmdline: string | undefined; // process
   jank_type: string | undefined;
   type: string | undefined;
diff --git a/ide/src/trace/component/SpMetrics.ts b/ide/src/trace/component/SpMetrics.ts
index b6aeaa1abddbcf7398911fc74ac0024f3e589731..d8b0d0b79706cdfcf47be6ad2068f9e0e7fbf15a 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 0b61a99aa224fc2bc08028b0d9617b35eb6df4af..d1656294b1b38433ff12c6f7f88f4131dd625f0b 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 0f4701cb54b1e2a2d0db910bfcc2badfd9f3c515..55517dc2addeb600ca201dca75d0276cfaec8bf6 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 16d1e12e83d9dd3bcbbc44d1b86cb2f565454c97..5a7cd590f37075d4d798ed978a119804e9d4c760 100644
--- a/ide/src/trace/component/SpSystemTrace.ts
+++ b/ide/src/trace/component/SpSystemTrace.ts
@@ -76,6 +76,7 @@ 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 { HeapTimelineStruct } from '../database/ui-worker/ProcedureWorkerHeapTimeline.js';
 import { TabPaneCurrentSelection } from './trace/sheet/TabPaneCurrentSelection.js';
 
 function dpr() {
@@ -174,7 +175,7 @@ export class SpSystemTrace extends BaseElement {
       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")
+      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');
@@ -287,18 +288,23 @@ 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 
+          // 取消收藏时,删除父亲ID
           let rowNameArr = currentRow.name.split("(");
           if (rowNameArr.length > 1) {
             let tempName = "";
@@ -445,6 +451,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 +496,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,
@@ -523,6 +527,26 @@ export class SpSystemTrace extends BaseElement {
             selection.nativeMemory.push(it.rowId!);
           }
           info('load nativeMemory traceRow id is : ', it.rowId);
+        } else if (it.rowType == TraceRow.ROW_TYPE_MONITOR) {
+          let abilityChildRows: Array> = [
+            ...this.shadowRoot!.querySelectorAll>(`trace-row[row-parent-id='${it.rowId}']`),
+          ];
+          if (!it.expansion) {
+            abilityChildRows = [...it.childrenList];
+          }
+          abilityChildRows.forEach((th) => {
+            th.rangeSelect = true;
+            th.checkType = '2';
+            if (th.rowType == TraceRow.ROW_TYPE_CPU_ABILITY) {
+              selection.cpuAbilityIds.push(th.rowId!);
+            } else if (th.rowType == TraceRow.ROW_TYPE_MEMORY_ABILITY) {
+              selection.memoryAbilityIds.push(th.rowId!);
+            } else if (th.rowType == TraceRow.ROW_TYPE_DISK_ABILITY) {
+              selection.diskAbilityIds.push(th.rowId!);
+            } else if (th.rowType == TraceRow.ROW_TYPE_NETWORK_ABILITY) {
+              selection.networkAbilityIds.push(th.rowId!);
+            }
+          });
         } else if (it.rowType == TraceRow.ROW_TYPE_CPU_ABILITY) {
           selection.cpuAbilityIds.push(it.rowId!);
           info('load CPU Ability traceRow id is : ', it.rowId);
@@ -657,21 +681,51 @@ export class SpSystemTrace extends BaseElement {
               }
             }
           });
-        } else if (it.rowType == TraceRow.ROW_TYPE_JANK && it.name == 'Actual Timeline') {
+        } else if (it.rowType == TraceRow.ROW_TYPE_JANK) {
           let isIntersect = (a: JanksStruct, b: RangeSelectStruct) =>
-            Math.max(a.ts! + a.dur!, b!.endNS || 0) - Math.min(a.ts!, b!.startNS || 0) <
-            a.dur! + (b!.endNS || 0) - (b!.startNS || 0);
-          let jankDatas = it.dataList.filter((jankData: any) => {
-            return isIntersect(jankData, TraceRow.rangeSelectObject!);
+              Math.max(a.ts! + a.dur!, b!.endNS || 0) - Math.min(a.ts!, b!.startNS || 0) <
+              a.dur! + (b!.endNS || 0) - (b!.startNS || 0);
+          if (it.name == 'Actual Timeline') {
+            selection.jankFramesData = [];
+            let jankDatas = it.dataList.filter((jankData: any) => {
+              return isIntersect(jankData, TraceRow.rangeSelectObject!);
+            });
+            selection.jankFramesData.push(jankDatas);
+          } else if (it.folder) {
+            selection.jankFramesData = [];
+            it.childrenList.forEach(child => {
+              if (child.rowType == TraceRow.ROW_TYPE_JANK && child.name == 'Actual Timeline') {
+                let jankDatas = child.dataList.filter((jankData: any) => {
+                  return isIntersect(jankData, TraceRow.rangeSelectObject!);
+                });
+                selection.jankFramesData.push(jankDatas);
+              }
+            })
+          }
+        } 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 = [];
+            }
           });
-          selection.jankFramesData.push(jankDatas);
-        } else if (it.rowType == TraceRow.ROW_TYPE_HEAP_TIMELINE) {
           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 +733,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 +755,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);
@@ -791,7 +844,9 @@ export class SpSystemTrace extends BaseElement {
           tr.sleeping = true;
           this.visibleRows = this.visibleRows.filter((it) => !it.sleeping);
         } else {
-          this.visibleRows.push(tr);
+          if (!this.visibleRows.find( vr => vr.rowId === tr.rowId && vr.rowType === tr.rowType && vr.rowParentId === tr.rowParentId)) {
+            this.visibleRows.push(tr);
+          }
           tr.sleeping = false;
         }
         if (this.handler) clearTimeout(this.handler);
@@ -821,7 +876,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 +888,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) {
@@ -962,7 +1024,7 @@ export class SpSystemTrace extends BaseElement {
   timerShaftELRangeClick = (sliceTime: SlicesTime | undefined | null) => {
     if (sliceTime) {
       setTimeout(() => {
-        this.traceSheetEL?.displayCurrent(sliceTime); // 给当前pane准备数据            
+        this.traceSheetEL?.displayCurrent(sliceTime); // 给当前pane准备数据
         let selection = this.timerShaftEL!.selectionMap.get(sliceTime.id);
         if (selection) {
           selection.isCurrentPane = true;  // 设置当前面板为可以显示的状态
@@ -1084,20 +1146,20 @@ export class SpSystemTrace extends BaseElement {
     });
     //draw flag line segment for canvas
     drawFlagLineSegment(this.canvasPanelCtx, this.hoverFlag, this.selectFlag, {
-      x: 0,
-      y: 0,
-      width: this.timerShaftEL?.canvas?.clientWidth,
-      height: this.canvasPanel?.clientHeight,
-    },
+        x: 0,
+        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,
-    },
+        x: 0,
+        y: 0,
+        width: this.timerShaftEL?.canvas?.clientWidth,
+        height: this.canvasFavoritePanel?.clientHeight,
+      },
       this.timerShaftEL!
     );
     //draw wakeup for main canvas
@@ -1160,7 +1222,6 @@ export class SpSystemTrace extends BaseElement {
         } as Rect,
       )
     };
-
     // Draw the connection curve
     if (this.linkNodes) {
       drawLinkLines(this.canvasPanelCtx!, this.linkNodes, this.timerShaftEL!, false);
@@ -1187,7 +1248,7 @@ export class SpSystemTrace extends BaseElement {
         x > (TraceRow.rangeSelectObject?.startX || 0) &&
         x < (TraceRow.rangeSelectObject?.endX || 0)
       ) {
-        let findSlicestime = this.timerShaftEL!.sportRuler?.findSlicesTime(x, y); // 查找帽子  
+        let findSlicestime = this.timerShaftEL!.sportRuler?.findSlicesTime(x, y); // 查找帽子
         if (!findSlicestime) { // 如果没有找到帽子,则绘制一个三角形的旗子
           let time = Math.round(
             (x * (TraceRow.range?.endNS! - TraceRow.range?.startNS!)) /
@@ -1260,7 +1321,7 @@ export class SpSystemTrace extends BaseElement {
     if (this.keyboardEnable) {
       if (keyPress == 'm') {
         this.slicestime = this.setSLiceMark(ev.shiftKey);
-        // 设置currentPane可以显示,并且修改调色板颜色和刚刚绘制的帽子颜色保持一致。 
+        // 设置currentPane可以显示,并且修改调色板颜色和刚刚绘制的帽子颜色保持一致。
         this.traceSheetEL = this.shadowRoot?.querySelector('.trace-sheet');
         let currentPane = this.traceSheetEL?.displayTab('tabpane-current');
         if (this.slicestime) {
@@ -1450,7 +1511,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 +1621,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();
       }
@@ -1673,7 +1734,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;
       }
@@ -2118,8 +2181,6 @@ export class SpSystemTrace extends BaseElement {
     }
   }
 
-
-
   connectedCallback() {
     this.initPointToEvent();
     /**
@@ -2176,7 +2237,7 @@ export class SpSystemTrace extends BaseElement {
       ev => throttle(this.myMouseMove, 350, ev)(),
       { passive: false }
     );
-	
+
     this.addEventListener(
       'mouseup',
       (e) => {
@@ -2195,6 +2256,12 @@ export class SpSystemTrace extends BaseElement {
       { passive: false }
     );
 
+    /**
+     * 泳道图中添加ctrl+鼠标滚轮事件,对泳道图进行放大缩小。
+     * 鼠标滚轮事件转化为键盘事件,keyPress和keyUp两个事件需要配合使用,
+     * 否则泳道图会一直放大或一直缩小。
+     * setTimeout()函数中的时间参数可以控制鼠标滚轮的频率。
+     */
     document.addEventListener(
       'wheel',
       (e) => {
@@ -2295,33 +2362,27 @@ export class SpSystemTrace extends BaseElement {
     }
   }
 
-  scrollToFunction(rowId: string, rowParentId: string, rowType: string, smooth: boolean = true, afterScroll: any) {
-    let row = this.shadowRoot!.querySelector>(`trace-row[row-id='${rowParentId}'][folder]`);
-    if (row) {
-      row.expansion = true;
-    }
-    let funcRow = this.shadowRoot!.querySelector>(`trace-row[row-id='${rowId}'][row-type='${rowType}']`);
-    if (funcRow == null) {
-      let threadRow = this.shadowRoot!.querySelector>(`trace-row[row-id='${rowId}'][row-type='thread']`);
-      this.rowsPaneEL!.scroll({
-        top: threadRow!.offsetTop - this.canvasPanel!.offsetHeight + threadRow!.offsetHeight + threadRow!.offsetHeight,
+  scrollToFunction(rowId: string, rowParentId: string, rowType: string, smooth: boolean = true) {
+    let condition = `trace-row[row-id='${rowId}'][row-type='${rowType}'][row-parent-id='${rowParentId}']`;
+    let rootRow = this.shadowRoot!.querySelector>(condition);
+    if (rootRow?.collect) {
+      this.favoriteRowsEL!.scroll({
+        top: (rootRow?.offsetTop || 0) - this.canvasFavoritePanel!.offsetHeight + (rootRow?.offsetHeight || 0),
         left: 0,
-        behavior: undefined,
+        behavior: smooth ? 'smooth' : undefined,
       });
-      if (threadRow != null) {
-        if (threadRow.isComplete) {
-          afterScroll();
-        } else {
-          threadRow.onComplete = () => {
-            funcRow = this.shadowRoot!.querySelector>(
-              `trace-row[row-id='${rowId}'][row-type='${rowType}']`
-            );
-            afterScroll();
-          };
-        }
-      }
     } else {
-      afterScroll();
+      let row = this.shadowRoot!.querySelector>(`trace-row[row-id='${rowParentId}'][folder]`);
+      if (row && !row.expansion) {
+        row.expansion = true;
+      }
+      if (rootRow && rootRow.offsetTop >= 0 && rootRow.offsetHeight >= 0) {
+        this.rowsPaneEL!.scroll({
+          top: (rootRow?.offsetTop || 0) - this.canvasPanel!.offsetHeight + 20,
+          left: 0,
+          behavior: smooth ? 'smooth' : undefined,
+        });
+      }
     }
   }
 
@@ -2653,6 +2714,7 @@ export class SpSystemTrace extends BaseElement {
       `trace-row[row-id='${funcRowID}'][row-type='func']`
     );
     if (targetRow) {
+      targetRow.highlight = highlight;
       //如果目标泳道图在收藏上面,则跳转至收藏
       let searchEntry = targetRow!.dataList!.find((dat) => dat.startTs === funcStract.startTime);
       toTargetDepth(searchEntry);
@@ -2684,8 +2746,11 @@ export class SpSystemTrace extends BaseElement {
     if (filterRow!.isComplete) {
       completeEntry();
     } else {
+      FuncStruct.hoverFuncStruct = funcStract;
+      FuncStruct.selectFuncStruct = funcStract;
+      this.onClickHandler(TraceRow.ROW_TYPE_FUNC);
       this.scrollToProcess(`${funcStract.tid}`, `${funcStract.pid}`, 'process', false);
-      this.scrollToProcess(`${funcStract.tid}`, `${funcStract.pid}`, 'func', true);
+      this.scrollToFunction(`${funcStract.tid}`, `${funcStract.pid}`, 'func', true);
       filterRow!.onComplete = completeEntry;
     }
   }
@@ -2824,9 +2889,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 +2904,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';
@@ -2859,8 +2924,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,6 +3059,7 @@ export class SpSystemTrace extends BaseElement {
       }
     }
   }
+
   queryCPUWakeUpList(data: WakeupBean) {
     TabPaneCurrentSelection.queryCPUWakeUpListFromBean(data).then((a: any) => {
       if (a === null) {
@@ -3003,6 +3069,7 @@ export class SpSystemTrace extends BaseElement {
       this.queryCPUWakeUpList(a);
     });
   }
+
   wakeupListNull() {
     SpSystemTrace.wakeupList = [];
   }
diff --git a/ide/src/trace/component/chart/FrameChart.ts b/ide/src/trace/component/chart/FrameChart.ts
index 7caac20b867068155e7d1a6116385850af57060d..e00285d8aaf8b03e2f0d575fd4b45359a7e9a707 100644
--- a/ide/src/trace/component/chart/FrameChart.ts
+++ b/ide/src/trace/component/chart/FrameChart.ts
@@ -732,12 +732,18 @@ export class FrameChart extends BaseElement {
             let count = ChartStruct.hoverFuncStruct!.count;
             this.hintContent = `
                         Name:  ${name}  
+ Lib: ${ChartStruct.hoverFuncStruct?.lib} +
+ Addr: ${ChartStruct.hoverFuncStruct?.addr}
Count: ${count}`; break; case ChartMode.Duration: let duration = Utils.getProbablyTime(ChartStruct.hoverFuncStruct!.dur); this.hintContent = ` Name: ${name}
+ Lib: ${ChartStruct.hoverFuncStruct?.lib} +
+ Addr: ${ChartStruct.hoverFuncStruct?.addr}
Duration: ${duration}`; break; } diff --git a/ide/src/trace/component/chart/SpChartManager.ts b/ide/src/trace/component/chart/SpChartManager.ts index e0512d73de93be5154f916cdbbdc29cf5ecc295c..68ca84d11e1b0aa1c56b4570fdfa117f42a22f98 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'); @@ -181,6 +179,8 @@ export class SpChartManager { endNS = startNS + 1; } this.trace.timerShaftEL.totalNS = total; + this.trace.timerShaftEL.getRangeRuler()!.drawMark = true; + this.trace.timerShaftEL.setRangeNS(0,total); (window as any).recordStartNS = startNS; (window as any).recordEndNS = endNS; (window as any).totalNS = total; diff --git a/ide/src/trace/component/chart/SpJsMemoryChart.ts b/ide/src/trace/component/chart/SpJsMemoryChart.ts index 0a612cbaf05531e9c8f34745c836abaf703d0d8d..d173e67481714d3154f78f29426b22cce1715a1f 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 1dfd5acad6fb1853211864136b227c81a4e60e08..990412d9a0be83932fb91af80e4ba19f2425fcd3 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 30322cbb819792dfc774e30b8cdcf8007e385a51..8fbf784afa964dc8a1387f0f869c03f93165d9b4 100644 --- a/ide/src/trace/component/chart/SpProcessChart.ts +++ b/ide/src/trace/component/chart/SpProcessChart.ts @@ -57,7 +57,7 @@ export class SpProcessChart { private processThreadDataCountMap: Map = new Map(); private processFuncDataCountMap: Map = new Map(); private processMemDataCountMap: Map = new Map(); - private threadFuncMaxDepthMap: Map = new Map(); + private threadFuncMaxDepthMap: Map = new Map(); constructor(trace: SpSystemTrace) { this.trace = trace; @@ -73,13 +73,13 @@ export class SpProcessChart { initDeliverInputEvent = async () => { let row = TraceRow.skeleton(); row.setAttribute('disabled-check', ''); - row.rowId = `DeliverInputEvent`; + row.rowId = 'DeliverInputEvent'; row.index = 0; row.rowType = TraceRow.ROW_TYPE_DELIVER_INPUT_EVENT; row.rowParentId = ''; row.folder = true; row.style.height = '40px'; - row.name = `DeliverInputEvent`; + row.name = 'DeliverInputEvent'; row.supplier = FolderSupplier(); row.onThreadHandler = FolderThreadHandler(row, this.trace); @@ -121,7 +121,7 @@ export class SpProcessChart { funcRow.rowType = TraceRow.ROW_TYPE_FUNC; funcRow.rowParentId = `${row.rowId}`; funcRow.rowHidden = !row.expansion; - funcRow.style.width = `100%`; + funcRow.style.width = '100%'; funcRow.style.height = `${maxHeight}px`; funcRow.setAttribute('height', `${maxHeight}`); funcRow.name = `${asyncFuncGroups[0].funName} ${key}`; @@ -151,7 +151,7 @@ export class SpProcessChart { let threadFuncMaxDepthArray = await getMaxDepthByTid(); info('Gets the maximum tier per thread , tid and maxDepth'); threadFuncMaxDepthArray.forEach((it) => { - this.threadFuncMaxDepthMap.set(it.tid, it.maxDepth); + this.threadFuncMaxDepthMap.set(`${it.ipid}-${it.tid}`, it.maxDepth); }); info('convert tid and maxDepth array to map'); let pidCountArray = await queryProcessContentCount(); @@ -174,7 +174,6 @@ export class SpProcessChart { return pre; }, {}); this.processThreads = Utils.removeDuplicates(queryProcessThreadResult, queryProcessThreadsByTableResult, 'tid'); - info('The amount of initialized process threads data is : ', this.processThreads!.length); if ( this.eventCountMap['print'] == 0 && @@ -285,11 +284,11 @@ export class SpProcessChart { expectedRow.rowType = TraceRow.ROW_TYPE_JANK; expectedRow.rowParentId = `${it.pid}`; expectedRow.rowHidden = !processRow.expansion; - expectedRow.style.width = `100%`; + expectedRow.style.width = '100%'; expectedRow.style.height = `${maxHeight}px`; expectedRow.setAttribute('height', `${maxHeight}`); expectedRow.setAttribute('frame_type', expectedData[0].frame_type); - expectedRow.name = `Expected Timeline`; + expectedRow.name = 'Expected Timeline'; expectedRow.addTemplateTypes('FrameTimeline'); expectedRow.setAttribute('children', ''); expectedRow.supplier = () => @@ -305,7 +304,7 @@ export class SpProcessChart { { context: context, useCache: useCache, - type: `expected_frame_timeline_slice`, + type: 'expected_frame_timeline_slice', }, expectedRow! ); @@ -335,6 +334,9 @@ export class SpProcessChart { if (isIntersect(depthArray[depthArray.length - 1], actualItem)) { actualItem.depth = depthArray.length; depthArray.push(actualItem); + } else { + actualItem.depth = depthArray.length - 1; + depthArray[length - 1] = actualItem; } } else { actualItem.depth = 0; @@ -350,10 +352,10 @@ export class SpProcessChart { actualRow.rowType = TraceRow.ROW_TYPE_JANK; actualRow.rowParentId = `${it.pid}`; actualRow.rowHidden = !processRow.expansion; - actualRow.style.width = `100%`; + actualRow.style.width = '100%'; actualRow.style.height = `${maxHeight}px`; actualRow.setAttribute('height', `${maxHeight}`); - actualRow.name = `Actual Timeline`; + actualRow.name = 'Actual Timeline'; actualRow.addTemplateTypes('FrameTimeline'); actualRow.setAttribute('frame_type', actualData[0].frame_type); actualRow.setAttribute('children', ''); @@ -368,7 +370,7 @@ export class SpProcessChart { { context: context, useCache: useCache, - type: `actual_frame_timeline_slice`, + type: 'actual_frame_timeline_slice', }, actualRow! ); @@ -495,7 +497,7 @@ export class SpProcessChart { funcRow.rowType = TraceRow.ROW_TYPE_FUNC; funcRow.rowParentId = `${it.pid}`; funcRow.rowHidden = !processRow.expansion; - funcRow.style.width = `100%`; + funcRow.style.width = '100%'; funcRow.style.height = `${maxHeight}px`; funcRow.setAttribute('height', `${maxHeight}`); funcRow.name = `${asyncFunctions[0].funName}`; @@ -531,7 +533,7 @@ export class SpProcessChart { row.rowParentId = `${it.pid}`; row.rowHidden = !processRow.expansion; row.style.height = '40px'; - row.style.width = `100%`; + row.style.width = '100%'; row.name = `${mem.trackName}`; row.setAttribute('children', ''); row.favoriteChangeHandler = this.trace.favoriteChangeHandler; @@ -589,13 +591,13 @@ export class SpProcessChart { threadRow.rowHidden = !processRow.expansion; threadRow.index = j; threadRow.style.height = '30px'; - threadRow.style.width = `100%`; + threadRow.style.width = '100%'; threadRow.name = `${thread.threadName || 'Thread'} ${thread.tid}`; threadRow.setAttribute('children', ''); 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); @@ -628,8 +630,8 @@ export class SpProcessChart { } else { processRow.addChildTraceRow(threadRow); } - if (this.threadFuncMaxDepthMap.get(thread.tid!) != undefined) { - let max = this.threadFuncMaxDepthMap.get(thread.tid!) || 1; + if (this.threadFuncMaxDepthMap.get(`${thread.upid}-${thread.tid}`) != undefined) { + let max = this.threadFuncMaxDepthMap.get(`${thread.upid}-${thread.tid}`) || 1; let maxHeight = max * 20; let funcRow = TraceRow.skeleton(); funcRow.rowId = `${thread.tid}`; @@ -637,12 +639,12 @@ export class SpProcessChart { funcRow.rowParentId = `${it.pid}`; funcRow.rowHidden = !processRow.expansion; funcRow.checkType = threadRow.checkType; - funcRow.style.width = `100%`; + funcRow.style.width = '100%'; funcRow.style.height = `${maxHeight}px`; funcRow.name = `${thread.threadName || 'Thread'} ${thread.tid}`; funcRow.setAttribute('children', ''); funcRow.supplier = () => - getFunDataByTid(thread.tid || 0).then((funs: Array) => { + getFunDataByTid(thread.tid || 0, thread.upid || 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 42ab450fb0430c7dae9c84f2afe479cdfc4be946..18603eef6b4eec6a812e8a88bcef224f6549029e 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 67bc60e8afae758fccc82a5561e5a01459366ef5..faf65092ab7abf7c8b2d566adabd609f02fcfd26 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 0d7a24125d730dc85b6bbd2087c24b276ed61577..a65624fee3d1b5d7c6fbb75f5df829eebebd3893 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 f7ad94fd34fe572e004c97a11fab2ab03d2b0aa2..fbe52fc858d7590a003b9a63cb0663ff4efc7380 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 70e75a90d15fa7a36fa4ab11ecd6200314d23bf5..49b4c3f34140018376604b713ce924d8549fa4cd 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 b57d6cb0a87cad8d00c55021487e1fc137a755ea..4483113db5f49aa1244e34ba75af48dde8c9f52f 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 a78a726dcb24f0fbce99c9428e5d60de243a5c26..5acad7582229e17c7196502e834c5e0aeb4264b8 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 dee35e8681ea42bd7c9ee53aed5ae296e09162a3..ef3498f3d50da3de75406a9b483c2522ec109122 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 6c498cab66c5429b2d9440a233e8b10098b7c870..7d9c8e3af6ac34c18be1ed2851a5857f4f3a45a4 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 e8566cd54afcfd31bf52f2bbcc079bb2b629a59d..97c511bbbf8be2f4f202d3828a453898aed5d087 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 57918df3de567188acbcedea19c11c723fb5088a..584258e58ec3e732cea732e2a2a0d597151538cd 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 7a3cfef2b268f3faa6de8505361218d198a61fb6..ebdebb8e599da57e4cf6714e5eead08b97a362bc 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 c0105ca32dc00309fc2e1d4e748d55c6e671f516..3c75eaf3045060a82945511fcad448476f3cf213 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 74f14a048ca7e903fdb34316e47c766abe042862..0cf21bbab518a60b963e288cd226ca6cd26c4c3b 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 c13b2281d1348cd0050801759d0f27ea8e6e7769..bcf541dd9ad9b955a15d98beaf19dabddf8e7925 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 f0b0b9daab2a1669c48ea5a67085469963f8337c..ae0b9893424bf72b1403a86852eefc4a84ba535f 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 e4c8e302f01315456fe378f5ae72ae5b33691c5e..8a42e304278a077d6ecf5d54b16a33fa2cfaee8d 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 2a1b0c10c81c1319cc95485e832ed916040d7540..9e47432a50ded8500fc96645e2f48fdd5feefa7b 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 257e41da5f1857e25bee239351ea353fd91777ca..bc00bb642668c57d7702b8299a5a459cdd644d94 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 ef099a96a80929cb89a8d51a5dd3a95f9d081b9e..d2a8c3deff10f588dbf4f3dafaa937f6be96cafc 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 4ec9edc8b3d7d8571a61d296919c111a14b65629..d00202810e643389103d1aa341ff0f40de062760 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 06cf4f6097993dfccb78b0f16908808128ced823..a827948659f99c6b19a8276005f8627af3864d43 100644 --- a/ide/src/trace/component/trace/TimerShaftElement.ts +++ b/ide/src/trace/component/trace/TimerShaftElement.ts @@ -59,6 +59,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; @@ -113,7 +134,6 @@ export class TimerShaftElement extends BaseElement { public selectionList: Array = []; public selectionMap: Map = new Map(); - get sportRuler(): SportRuler | undefined { return this._sportRuler; } @@ -161,7 +181,12 @@ export class TimerShaftElement extends BaseElement { reset(): void { this.loadComplete = false; + this.totalNS = 10_000_000_000; + this.startNS = 0; + this.endNS = 10_000_000_000; if (this.rangeRuler) { + this.rangeRuler.drawMark = false; + this.rangeRuler.range.totalNS = this.totalNS; this.rangeRuler.markAObj.frame.x = 0; this.rangeRuler.markBObj.frame.x = this.rangeRuler.frame.width; this.rangeRuler.cpuUsage = []; @@ -169,11 +194,12 @@ export class TimerShaftElement extends BaseElement { this.sportRuler!.slicesTimeList.length = 0; this.selectionList.length = 0; this.selectionMap.clear(); + this.rangeRuler.rangeRect = new Rect(0, 25, this.canvas?.clientWidth || 0, 75); this.sportRuler!.isRangeSelect = false; this.setSlicesMark(); } this.removeTriangle('inverted'); - this.totalNS = 10_000_000_000; + this.setRangeNS(0,this.endNS); } initElements(): void { @@ -187,6 +213,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 +228,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) { @@ -242,8 +273,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 +296,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,9 +327,9 @@ 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); // 查找帽子 + 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); @@ -313,7 +340,7 @@ export class TimerShaftElement extends BaseElement { } } else { this.sportRuler?.clearHoverFlag(); - this.sportRuler?.modifyFlagList(null);//重新绘制旗子,清除hover flag + this.sportRuler?.modifyFlagList(null);//重新绘制旗子,清除hover flag } }; @@ -385,7 +412,6 @@ export class TimerShaftElement extends BaseElement { modifySlicesList(slicestime: SlicesTime | null | undefined) { this._sportRuler?.modifySicesTimeList(slicestime); } - cancelPressFrame() { this.rangeRuler?.cancelPressFrame(); } @@ -417,7 +443,7 @@ export class TimerShaftElement extends BaseElement { selection.isCurrentPane = true; // 设置当前面板为可以显示的状态 //把刚刚创建的slicetime和selection对象关联起来,以便后面再次选中“跑道”的时候显示对应的面板。 this.selectionMap.set(sliceTime.id, selection); - this.traceSheetEL?.rangeSelect(selection); // 显示选中区域对应的面板 + this.traceSheetEL?.rangeSelect(selection); // 显示选中区域对应的面板 } } return sliceTime; diff --git a/ide/src/trace/component/trace/base/ColorUtils.ts b/ide/src/trace/component/trace/base/ColorUtils.ts index f838e36e8c1e07bfc0d83f6d1ca96b039583f769..12681ffb2631ed601a8726a969cd028b4c5430ba 100644 --- a/ide/src/trace/component/trace/base/ColorUtils.ts +++ b/ide/src/trace/component/trace/base/ColorUtils.ts @@ -51,7 +51,7 @@ export class ColorUtils { '#C6D9F2', ]; - public static JANK_COLOR: Array = ['#42A14D', '#C0CE85', '#FF651D', '#FFE335', '#009DFA', '#E97978']; + public static JANK_COLOR: Array = ['#42A14D', '#C0CE85', '#FF651D', '#E8BE44', '#009DFA', '#E97978']; public static MD_PALETTE: Array = ColorUtils.FUNC_COLOR_B; public static FUNC_COLOR: Array = ColorUtils.FUNC_COLOR_B; diff --git a/ide/src/trace/component/trace/base/TraceRow.ts b/ide/src/trace/component/trace/base/TraceRow.ts index 223600a87ffbc12e6ee00598aab098fe233a3aee..ae07e7559cf32f8b558d26709503689c534e64df 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> = []; diff --git a/ide/src/trace/component/trace/base/TraceRowConfig.ts b/ide/src/trace/component/trace/base/TraceRowConfig.ts index 404c637cb863be14555603b3c49183b61740849f..f036c59d9d4c509b61b6d8f6020a41e319753546 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,37 @@ 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 { + row.expansion = true; + 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 8ee02db5afd7e85390c080f3bc9018c16620a307..d554f88c83dc82b91548dfaef9b769159d850e23 100644 --- a/ide/src/trace/component/trace/base/TraceSheet.ts +++ b/ide/src/trace/component/trace/base/TraceSheet.ts @@ -270,17 +270,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 = ''; diff --git a/ide/src/trace/component/trace/base/TraceSheetConfig.ts b/ide/src/trace/component/trace/base/TraceSheetConfig.ts index 22eee39f141a77c266b9729424dea93595107f90..fccc11b170adf17a7aaf17f111f0953f091b0a3f 100644 --- a/ide/src/trace/component/trace/base/TraceSheetConfig.ts +++ b/ide/src/trace/component/trace/base/TraceSheetConfig.ts @@ -72,8 +72,9 @@ 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'; +import { TabPaneCurrent } from '../sheet/TabPaneCurrent.js'; + export let tabConfig: any = { 'tabpane-current': { title: 'Current Selection', diff --git a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts index 74e66f85972764eba02ccca0656f5555aeee129a..8287c1040ca67290a5b4ef4f9625caaf85405b65 100644 --- a/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts +++ b/ide/src/trace/component/trace/sheet/TabPaneCurrentSelection.ts @@ -104,7 +104,7 @@ export class TabPaneCurrentSelection extends BaseElement { callback: ((data: WakeupBean | null) => void) | undefined = undefined, scrollCallback?: (data: CpuStruct) => void ) { - this.setTableHeight('300px'); + this.setTableHeight('550px'); let leftTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#leftTitle'); if (leftTitle) { leftTitle.innerText = 'Slice Details'; @@ -168,8 +168,7 @@ 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 rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton')?.shadowRoot?.querySelector("#custom-button"); let threadClick = this.currentSelectionTbl?.shadowRoot?.querySelector('#thread-id'); threadClick?.addEventListener('click', () => { //cpu点击 @@ -339,8 +338,7 @@ 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"); + let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton')?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; rightButton!.style.visibility = 'hidden'; @@ -390,11 +388,10 @@ export class TabPaneCurrentSelection extends BaseElement { } setIrqData(data: IrqStruct) { - this.setTableHeight('300px'); + this.setTableHeight('550px'); this.initCanvas(); let rightTitle: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightTitle'); - let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton') - ?.shadowRoot?.querySelector("#custom-button"); + let rightButton: HTMLElement | null | undefined = this?.shadowRoot?.querySelector('#rightButton')?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; rightButton!.style.visibility = 'hidden'; @@ -426,12 +423,12 @@ export class TabPaneCurrentSelection extends BaseElement { scrollWakeUp: (d: any) => void | undefined ) { //线程信息 - this.setTableHeight('350px'); + this.setTableHeight('550px'); 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"); + ?.shadowRoot?.querySelector("#custom-button"); if (rightTitle) { rightTitle.style.visibility = 'hidden'; rightButton!.style.visibility = 'hidden'; @@ -558,48 +555,14 @@ export class TabPaneCurrentSelection extends BaseElement { this.setTableHeight('550px'); this.tabCurrentSelectionInit('Slice Details'); let list: any[] = []; - list.push({ name: 'Name', value: data.name }); - list.push({ name: 'StartTime', value: getTimeString(data.ts || 0) }); - list.push({ - name: 'Absolute Time', - value: ((window as any).recordStartNS + data.ts) / 1000000000, - }); - list.push({ - name: 'Duration', - value: data.dur ? getTimeString(data.dur) : ' ', - }); - if (data.frame_type != 'frameTime') { - list.push({ - name: 'Process', - value: data.cmdline + ' ' + data.pid, - }); - } + this.setJankCommonMessage(list, data); if (data.type == '0') { - if (data.jank_tag) { - if (data.frame_type === 'render_service') { - list.push({ - name: 'Jank Type', - value: 'RenderService Deadline Missed', - }); - } else if (data.frame_type === 'app') { - list.push({ - name: 'Jank Type', - value: 'APP Deadline Missed', - }); - } else if (data.frame_type === 'frameTime') { - list.push({ name: 'Jank Type', value: 'Deadline Missed' }); - } - } else { - list.push({ name: 'Jank Type', value: 'NONE' }); - } + this.setJankType(data, list); let jankJumperList = new Array(); if (data.frame_type === 'render_service') { queryGpuDur(data.id!).then((it) => { if (it.length > 0) { - list.push({ - name: `
Gpu Duration
`, - value: getTimeString(it[0].gpu_dur), - }); + list.push({ name: `
Gpu Duration
`, value: getTimeString(it[0].gpu_dur)}); } }); if (data.src_slice) { @@ -611,12 +574,9 @@ export class TabPaneCurrentSelection extends BaseElement { }); it.forEach((a: any) => { let appNode = new JankTreeNode(a.name, a.pid, 'app'); - let timeLineNode = new JankTreeNode(a.name, a.pid, 'frameTime'); - appNode.children.push(timeLineNode); + appNode.children.push(new JankTreeNode(a.name, a.pid, 'frameTime')); jankJumperList.push(appNode); - list.push({ - name: `
Slice
`, - value: + list.push({name: `
Slice
`, value: a.cmdline + ' [' + a.name + @@ -752,21 +712,7 @@ export class TabPaneCurrentSelection extends BaseElement { appNode.children.push(rsNode); jankJumperList.push(appNode); this.currentSelectionTbl!.dataSource = list; - let all = this.currentSelectionTbl?.shadowRoot?.querySelectorAll(`.jank_cla`); - all!.forEach((a) => { - a!.addEventListener('click', () => { - if (scrollCallback) { - scrollCallback({ - rowId: a.id, - name: a.getAttribute('slice_name'), - pid: a.getAttribute('pid'), - }); - } - }); - }); - if (callback) { - callback(jankJumperList); - } + this.addJankScrollCallBackEvent(scrollCallback, callback, jankJumperList); }); } } else { @@ -774,6 +720,30 @@ export class TabPaneCurrentSelection extends BaseElement { } } + private setJankType(data: JankStruct, list: any[]) { + if (data.jank_tag === 1) { + if (data.frame_type === 'render_service') { + list.push({ name: 'Jank Type', value: 'RenderService Deadline Missed' }); + } else if (data.frame_type === 'app') { + list.push({ name: 'Jank Type', value: 'APP Deadline Missed' }); + } else if (data.frame_type === 'frameTime') { + list.push({ name: 'Jank Type', value: 'Deadline Missed' }); + } + } else if (data.jank_tag === 3) { + list.push({ name: 'Jank Type', value: 'Deadline Missed' }); + } else { + list.push({ name: 'Jank Type', value: 'NONE' }); + } + } + private setJankCommonMessage(list: any[], data: JankStruct) { + list.push({ name: 'Name', value: data.name }); + list.push({ name: 'StartTime', value: getTimeString(data.ts || 0) }); + list.push({ name: 'Absolute Time', value: ((window as any).recordStartNS + data.ts) / 1000000000 }); + list.push({ name: 'Duration', value: data.dur ? getTimeString(data.dur) : ' ' }); + if (data.frame_type != 'frameTime') { + list.push({ name: 'Process', value: data.cmdline + ' ' + data.pid }); + } + } private setTableHeight(height: string) { this.scrollView!.scrollTop = 0; this.currentSelectionTbl!.style.height = height; @@ -881,6 +851,7 @@ export class TabPaneCurrentSelection extends BaseElement { } return wb; } + /** * 查询出 线程唤醒了哪些线程信息 */ @@ -1056,7 +1027,7 @@ export class TabPaneCurrentSelection extends BaseElement { } .table-left{ width: 50%; - height: 500px; + height: auto; padding: 0 10px; } .table-right{ 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 276a3b1cad9b8f5efdd03c8727c87f9379fc3230..20eca20e64daa72b3151b34ec7a4fc4553c433c7 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 2e33eeb2d1a7a4630b8dc9742a1c377d196da850..8c01e3c80a96513e80a614f827be83f8cc502c83 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 743e59a459078a8f580e5e32099d9e123199e9e1..3348318ca8268313bd9e758186654e4a027cf7f8 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 be7cb0953e1f95a2ef2bfb4e52534d9d2f593f3f..8799248200caeb296af74d1df281f050b8291102 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/jank/TabPaneFrames.ts b/ide/src/trace/component/trace/sheet/jank/TabPaneFrames.ts index c6332e49f87588cccc3c01b2a4eac2de0972b8de..db89ff30051c1952ab399bbad2d77362aaabe574 100644 --- a/ide/src/trace/component/trace/sheet/jank/TabPaneFrames.ts +++ b/ide/src/trace/component/trace/sheet/jank/TabPaneFrames.ts @@ -40,81 +40,13 @@ export class TabPaneFrames extends BaseElement { framesParam.jankFramesData.forEach((data: Array) => { sumRes.occurrences += data.length; data.forEach((structValue: JanksStruct) => { - if (structValue.dur == null || structValue.dur == undefined) { - structValue.dur = 0; - } if (structValue.frame_type == 'app') { - if (structValue.jank_tag) { - appJank.flag = structValue.jank_tag; - appJank.jankType = 'APP Deadline Missed'; - appJank.occurrences += 1; - appJank.maxDuration = Math.max(structValue.dur, appJank.maxDuration!); - if (appJank.minDuration == -1) { - appJank.minDuration = structValue.dur; - } else { - appJank.minDuration = Math.min(structValue.dur, appJank.minDuration!); - } - if (appJank.meanDuration == -1) { - appJank.meanDuration = structValue.dur; - } else { - appJank.meanDuration = Number(((structValue.dur + appJank.meanDuration!) / 2).toFixed(2)); - } - } else { - this.refreshNoJankData(noJank, structValue); - } + this.appJankDataHandle(structValue, appJank, noJank); } else if (structValue.frame_type == 'renderService') { - if (structValue.jank_tag) { - rsJank.flag = structValue.jank_tag; - rsJank.jankType = 'RenderService Deadline Missed'; - rsJank.occurrences += 1; - rsJank.maxDuration = Math.max(structValue.dur, rsJank.maxDuration!); - if (rsJank.minDuration == -1) { - rsJank.minDuration = structValue.dur; - } else { - rsJank.minDuration = Math.min(structValue.dur, rsJank.minDuration!); - } - if (rsJank.meanDuration == -1) { - rsJank.meanDuration = structValue.dur; - } else { - rsJank.meanDuration = Number(((structValue.dur + rsJank.meanDuration!) / 2).toFixed(2)); - } - } else { - this.refreshNoJankData(noJank, structValue); - } + this.rsJankDataHandle(structValue, rsJank, noJank); } else { // frameTime - if (structValue.jank_tag) { - appJank.flag = structValue.jank_tag; - appJank.jankType = 'Deadline Missed'; - appJank.occurrences += 1; - appJank.maxDuration = Math.max(structValue.dur, appJank.maxDuration); - appJank.minDuration = Math.min(structValue.dur, appJank.minDuration); - if (appJank.minDuration == -1) { - appJank.minDuration = structValue.dur; - } else { - appJank.minDuration = Math.min(structValue.dur, appJank.minDuration!); - } - if (appJank.meanDuration == -1) { - appJank.meanDuration = structValue.dur; - } else { - appJank.meanDuration = Number(((structValue.dur + appJank.meanDuration) / 2).toFixed(2)); - } - } else { - noJank.flag = structValue.jank_tag; - noJank.jankType = 'None'; - noJank.occurrences += 1; - noJank.maxDuration = Math.max(structValue.dur, noJank.maxDuration); - if (noJank.minDuration == -1) { - noJank.minDuration = structValue.dur; - } else { - noJank.minDuration = Math.min(structValue.dur, noJank.minDuration!); - } - if (noJank.meanDuration == -1) { - noJank.meanDuration = structValue.dur; - } else { - noJank.meanDuration = Number(((structValue.dur + noJank.meanDuration) / 2).toFixed(2)); - } - } + this.frameTimelineJankDataHandle(structValue, appJank, noJank); } }); }); @@ -141,6 +73,89 @@ export class TabPaneFrames extends BaseElement { this.framesTbl!.recycleDataSource = tablelist; } + private frameTimelineJankDataHandle(structValue: JanksStruct, appJank: JankFramesStruct, noJank: JankFramesStruct) { + if (structValue.dur == null || structValue.dur == undefined) { + structValue.dur = 0; + } + if (structValue && structValue.jank_tag && structValue.jank_tag > 0) { + appJank.flag = structValue.jank_tag; + appJank.jankType = 'Deadline Missed'; + appJank.occurrences += 1; + appJank.maxDuration = Math.max(structValue.dur, appJank.maxDuration); + appJank.minDuration = Math.min(structValue.dur, appJank.minDuration); + if (appJank.minDuration == -1) { + appJank.minDuration = structValue.dur; + } else { + appJank.minDuration = Math.min(structValue.dur, appJank.minDuration!); + } + if (appJank.meanDuration == -1) { + appJank.meanDuration = structValue.dur; + } else { + appJank.meanDuration = Number(((structValue.dur + appJank.meanDuration) / 2).toFixed(2)); + } + } else { + noJank.flag = structValue.jank_tag; + noJank.jankType = 'None'; + noJank.occurrences += 1; + noJank.maxDuration = Math.max(structValue.dur, noJank.maxDuration); + if (noJank.minDuration == -1) { + noJank.minDuration = structValue.dur; + } else { + noJank.minDuration = Math.min(structValue.dur, noJank.minDuration!); + } + if (noJank.meanDuration == -1) { + noJank.meanDuration = structValue.dur; + } else { + noJank.meanDuration = Number(((structValue.dur + noJank.meanDuration) / 2).toFixed(2)); + } + } + } + private rsJankDataHandle(structValue: JanksStruct, rsJank: JankFramesStruct, noJank: JankFramesStruct) { + if (structValue.dur == null || structValue.dur == undefined) { + structValue.dur = 0; + } + if (structValue.jank_tag && structValue.jank_tag > 0) { + rsJank.flag = structValue.jank_tag; + rsJank.jankType = 'RenderService Deadline Missed'; + rsJank.occurrences += 1; + rsJank.maxDuration = Math.max(structValue.dur, rsJank.maxDuration!); + if (rsJank.minDuration == -1) { + rsJank.minDuration = structValue.dur; + } else { + rsJank.minDuration = Math.min(structValue.dur, rsJank.minDuration!); + } + if (rsJank.meanDuration == -1) { + rsJank.meanDuration = structValue.dur; + } else { + rsJank.meanDuration = Number(((structValue.dur + rsJank.meanDuration!) / 2).toFixed(2)); + } + } else { + this.refreshNoJankData(noJank, structValue); + } + } + private appJankDataHandle(structValue: JanksStruct, appJank: JankFramesStruct, noJank: JankFramesStruct) { + if (structValue.dur == null || structValue.dur == undefined) { + structValue.dur = 0; + } + if (structValue.jank_tag && structValue.jank_tag > 0) { + appJank.flag = structValue.jank_tag; + appJank.jankType = 'APP Deadline Missed'; + appJank.occurrences += 1; + appJank.maxDuration = Math.max(structValue.dur, appJank.maxDuration!); + if (appJank.minDuration == -1) { + appJank.minDuration = structValue.dur; + } else { + appJank.minDuration = Math.min(structValue.dur, appJank.minDuration!); + } + if (appJank.meanDuration == -1) { + appJank.meanDuration = structValue.dur; + } else { + appJank.meanDuration = Number(((structValue.dur + appJank.meanDuration!) / 2).toFixed(2)); + } + } else { + this.refreshNoJankData(noJank, structValue); + } + } private refreshNoJankData(noJank: JankFramesStruct, structValue: JanksStruct) { noJank.flag = structValue.jank_tag; noJank.jankType = 'None'; 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 5c992a06fd96f97068a97a4599961620365dd1d9..76feb0f47df6c9a2d6ff1a15d932cd7fc2902b3f 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 { - + - + - + - + - + - +