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 ThreadInitConfig {
17  endTs: number = 0;
18  pid: number = -1;
19  state: string = '';
20  tid: number = -1;
21  ts: number = -1;
22  dur: number = -1;
23  duration: number = -1;
24  cycleStartTime: number = -1;
25  cycleEndTime: number = -1;
26}
27export class SchedSwitchCountBean {
28  nodeFlag: string | undefined;
29  startNS: number;
30  cycleStartTime: string = '';
31  dur: number | string;
32  duration: number | string;
33  cycle: number = -1;
34  title: string = '';
35  value: number = 0;
36  level: string = '';
37  colorIndex: number = -1;
38  children: Array<SchedSwitchCountBean> = [];
39  constructor(
40    nodeFlag: string | undefined,
41    startNS: number,
42    cycleStartTime: string,
43    dur: number | string,
44    duration: number | string,
45    cycle: number,
46    title: string,
47    value: number,
48    level: string,
49    colorIndex: number,
50    children: Array<SchedSwitchCountBean>
51  ) {
52    this.nodeFlag = nodeFlag;
53    this.startNS = startNS;
54    this.cycleStartTime = cycleStartTime;
55    this.dur = dur;
56    this.duration = duration;
57    this.cycle = cycle;
58    this.title = title;
59    this.value = value;
60    this.level = level;
61    this.colorIndex = colorIndex;
62    this.children = children;
63  }
64}
65export class TreeSwitchConfig {
66  value: number = 0;
67  dur!: number | string | undefined;
68  duration!: number | string | undefined;
69  isHover?: boolean = false;
70  isSelected?: boolean = false;
71  cycle?: number = 0;
72  level: string = '';
73  pid: number = -1;
74  process: string | undefined;
75  status?: boolean = false;
76  thread: string | undefined;
77  tid: number = -1;
78  title: string = '';
79  cycleStartTime!: number | string | undefined;
80  children: Array<TreeSwitchConfig> = [];
81}
82export class HistogramSourceConfig {
83  average: number = 0;
84  color: string = '';
85  value: number = 0;
86  cycleNum: number = 0;
87  isHover: boolean = false;
88  size: string = '';
89}
90export class CutDataObjConfig {
91  cyclesArr: Array<SchedSwitchCountBean> = [];
92  pid: number = -1;
93  tid: number = -1;
94  process: string | undefined;
95  thread: string | undefined;
96  processTitle: string = '';
97  threadTitle: string = '';
98  threadCountTotal: number = 0;
99  threadDurTotal!: number | string;
100}
101