1/* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export class TabPaneFreqUsageConfig { 17 thread: string = ''; 18 ts: number | string; 19 pid: number | string; 20 tid: number | string; 21 count: number = 0; 22 cpu: number | string; 23 freq: number | string; 24 dur: number = 0; 25 cdur: string = ''; 26 percent: number | string; 27 flag: string = ''; 28 id: number = -1; 29 children: Array<TabPaneFreqUsageConfig> | undefined; 30 constructor( 31 thread: string, 32 ts: number | string, 33 pid: number | string, 34 tid: number | string, 35 count: number, 36 cpu: number | string, 37 freq: number | string, 38 dur: number, 39 cdur: string, 40 percent: number | string, 41 flag: string, 42 id: number, 43 children: Array<TabPaneFreqUsageConfig> | undefined 44 ) { 45 this.thread = thread; 46 this.ts = ts; 47 this.pid = pid; 48 this.tid = tid; 49 this.count = count; 50 this.cpu = cpu; 51 this.freq = freq; 52 this.dur = dur; 53 this.cdur = cdur; 54 this.percent = percent; 55 this.flag = flag; 56 this.id = id; 57 this.children = children; 58 } 59} 60 61export class TabPaneRunningConfig { 62 thread: string = ''; 63 process: string = ''; 64 ts: number = 0; 65 pid: number = 0; 66 tid: number = 0; 67 cpu: number = -1; 68 dur: number = 0; 69 constructor(process: string, thread: string, ts: number, pid: number, tid: number, cpu: number, dur: number) { 70 this.process = process; 71 this.thread = thread; 72 this.ts = ts; 73 this.pid = pid; 74 this.tid = tid; 75 this.cpu = cpu; 76 this.dur = dur; 77 } 78} 79export class TabPaneCpuFreqConfig { 80 startNS: number = 0; 81 value: number = 0; 82 cpu: number = 0; 83 dur: number = 0; 84 constructor(startNS: number, cpu: number, value: number, dur: number) { 85 this.startNS = startNS; 86 this.cpu = cpu; 87 this.value = value; 88 this.dur = dur; 89 } 90} 91 92export interface RunningData { 93 pid: number; 94 tid: number; 95 cpu: number; 96 dur: number; 97 ts: number; 98} 99 100export interface CpuFreqData { 101 ts: number; 102 cpu: number; 103 value: number; 104 dur: number; 105} 106 107export interface RunningFreqData { 108 thread?: string; 109 cpu: number; 110 dur: number; 111 consumption: number; 112 frequency: number | string; 113 percent: number; 114 consumpower: number; 115 cpuload: number; 116 children?: Array<RunningFreqData>; 117 ts?:number; 118} 119 120export interface CpuFreqTd { 121 startNS: number; 122 filter_id: number; 123 value: number; 124 dur: number; 125} 126