• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 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
16/**
17 * GPData实体类
18 */
19export class GPData {
20  public moduleType: String;
21  public timeStamp: number;
22  public values: Map<String, String>;
23
24  constructor(moduleType: String, timeStamp: number, values: Map<String, String>) {
25    this.moduleType = moduleType;
26    this.timeStamp = timeStamp;
27    this.values = values;
28  }
29
30  toString() {
31    var obj = Object.create(null);
32    var iterator = this.values.keys();
33    for (var i = 0; i < this.values.size; i++) {
34      var key = iterator.next().value;
35      obj[key] = this.values.get(key);
36    }
37    return (
38      'GPData{' +
39      "module='" +
40      this.moduleType +
41      "'" +
42      ', timeStamp=' +
43      this.timeStamp +
44      ', values=' +
45      JSON.stringify(obj) +
46      '}'
47    );
48  }
49}
50
51/**
52 * 任务列表页  任务概览页实体类
53 */
54export class TGeneralInfo {
55  //目录生成的UUID  作为主键
56  public sessionId: String;
57  //任务Id
58  public taskId: String;
59  //测试游戏名称
60  public appName: String;
61  //测试游戏版本
62  public appVersion: String;
63  //游戏包名
64  public packageName: String;
65  //开始时间
66  public startTime: number;
67  //结束时间
68  public endTime: number;
69  //测试时长
70  public testDuration: number;
71  //任务名称
72  public taskName: String;
73  //测试方式  middle
74  public testCase: String;
75  //测试类型  smartPerf beta
76  public testType: String;
77  //用户名
78  public user: String;
79  //用户id
80  public userId: String;
81  //项目Id
82  public projectId: String;
83  //报告来源
84  public dataSource: String;
85  //sp版本
86  public spVersion: String;
87  //设备类型
88  public deviceTypeName: String;
89  //设备品牌
90  public brand: String;
91  //设备名称  XX-XXX(****00018)
92  public deviceName: String;
93  //设备型号
94  public board: String;
95  //手机版本
96  public version: String;
97  //芯片平台
98  public plat: String;
99  //大中小核心
100  public cpuCluster: String;
101  //设备sn号
102  public sn: String;
103  //分辨类
104  public resolution: String;
105  //当前亮度
106  public screenBrightness: String;
107  //设备当前音量
108  public volume: String;
109  //当前电池电量
110  public batteryVolume: String;
111  //是否是多路测试
112  public isOnline: boolean;
113  //设备号
114  public deviceNum: number;
115  //房间号
116  public roomNumber: String;
117  //任务类型 主控、被控
118  public taskType: number;
119
120  constructor(
121    sessionId?: String,
122    taskId?: String,
123    appName?: String,
124    appVersion?: String,
125    packageName?: String,
126    startTime?: number,
127    endTime?: number,
128    testDuration?: number,
129    taskName?: String
130  ) {
131    this.sessionId = sessionId;
132    this.taskId = taskId;
133    this.appName = appName;
134    this.appVersion = appVersion;
135    this.packageName = packageName;
136    this.startTime = startTime;
137    this.endTime = endTime;
138    this.testDuration = testDuration;
139    this.taskName = taskName;
140  }
141}
142
143/**
144 * 任务详情实体类
145 */
146export class TIndexInfo {
147  //时间戳 主键
148  public timestamp: String;
149  //任务ID
150  public taskId: String;
151  //场景标识
152  public flag: String;
153  //温度
154  public shellBackTemp: String;
155  public shellFrameTemp: String;
156  public shellFrontTemp: String;
157  public socThermalTemp: String;
158  public systemHTemp: String;
159  public gpuTemp: String;
160  public ambientTemp: String;
161  public batteryTemp: String;
162
163  //ddr
164  public ddrFrequency: String;
165  //fps
166  public fps: String;
167  public fpsJitters: String;
168  //cpu
169  public cpu0Frequency: String;
170  public cpu0Load: String;
171  public cpu1Frequency: String;
172  public cpu1Load: String;
173  public cpu2Frequency: String;
174  public cpu2Load: String;
175  public cpu3Frequency: String;
176  public cpu3Load: String;
177  public cpu4Frequency: String;
178  public cpu4Load: String;
179  public cpu5Frequency: String;
180  public cpu5Load: String;
181  public cpu6Frequency: String;
182  public cpu6Load: String;
183  public cpu7Frequency: String;
184  public cpu7Load: String;
185  public cpuLoad: String;
186  //gpu
187  public gpuFrequency: String;
188  public gpuLoad: String;
189  //power
190  public currentNow: String;
191  public capacity: String;
192  public enableHiz: String;
193  public status: String;
194  public voltageNow: String;
195  //ram
196  public pss: String;
197  //HWCPipeGPU
198  public cacheMisses: String;
199  public instructions: String;
200  //HWCPipeGPU
201  public gpuCycles: String;
202  public vertexComputeCycles: String;
203  public fragmentCycles: String;
204  public tilerCycles: String;
205  public vertexComputeJobs: String;
206  public fragmentJobs: String;
207  public pixels: String;
208  public earlyZTests: String;
209  public earlyZKilled: String;
210  public externalMemoryReadAccesses: String;
211  public externalMemoryWriteAccesses: String;
212  public externalMemoryReadBytes: String;
213  public externalMemoryWriteBytes: String;
214  public cacheWriteLookups: String;
215  public cacheReadLookups: String;
216  public externalMemoryWriteStalls: String;
217  public externalMemoryReadStalls: String;
218  public shaderCycles: String;
219  public shaderArithmeticCycles: String;
220  public shaderLoadStoreCycles: String;
221  public shaderTextureCycles: String;
222
223  //QPCounters
224  public clocksSecond: String;
225  public gpuUtilization: String;
226  public gpuBusBusy: String;
227  public verticesShadedSecond: String;
228  public fragmentsShadedSecond: String;
229  public texturesVertex: String;
230  public texturesFragment: String;
231  public aluVertex: String;
232  public aluFragment: String;
233  public timeShadingFragments: String;
234  public timeShadingVertices: String;
235  public timeCompute: String;
236  public readTotal: String;
237  public writeTotal: String;
238  public textureMemoryReadBW: String;
239  public vertexMemoryRead: String;
240  public spMemoryRead: String;
241  public qpGPUFrequency: String;
242  //network
243  public currNetworkType: String;
244  public networkUpSpeed: String;
245  public networkDownSpeed: String;
246  public wlanSingleIntensity: String;
247  public radioSingleIntensity: String;
248  public networkDelaySdk: String;
249  constructor(
250    timestamp?: String,
251    taskId?: String,
252    cpu0Freq?: String,
253    cpu1Freq?: String,
254    cpu2Freq?: String,
255    cpu3Freq?: String,
256    cpu4Freq?: String,
257    cpu5Freq?: String,
258    cpu6Freq?: String,
259    cpu7Freq?: String,
260    cpu0Load?: string,
261    cpu1Load?: string,
262    cpu2Load?: string,
263    cpu3Load?: string,
264    cpu4Load?: string,
265    cpu5Load?: string,
266    cpu6Load?: string,
267    cpu7Load?: string,
268    gpuFreq?: String,
269    gpuLoad?: String,
270    ddrFreq?: String,
271    shellFrame?: String,
272    shellFront?: String,
273    shellBack?: String,
274    socThermal?: String,
275    systemH?: String,
276    gpu?: String,
277    ambient?: String,
278    battery?: String,
279    currentNow?: String,
280    voltageNow?: String,
281    pss?: String,
282    fps?: String,
283    fpsJitters?: String,
284    networkUpSpeed?: String,
285    networkDownSpeed?: String
286  ) {
287    this.timestamp = timestamp;
288    this.taskId = taskId;
289    this.cpu0Frequency = cpu0Freq;
290    this.cpu1Frequency = cpu1Freq;
291    this.cpu2Frequency = cpu2Freq;
292    this.cpu3Frequency = cpu3Freq;
293    this.cpu4Frequency = cpu4Freq;
294    this.cpu5Frequency = cpu5Freq;
295    this.cpu6Frequency = cpu6Freq;
296    this.cpu7Frequency = cpu7Freq;
297    this.cpu0Load = cpu0Load;
298    this.cpu1Load = cpu1Load;
299    this.cpu2Load = cpu2Load;
300    this.cpu3Load = cpu3Load;
301    this.cpu4Load = cpu4Load;
302    this.cpu5Load = cpu5Load;
303    this.cpu6Load = cpu6Load;
304    this.cpu7Load = cpu7Load;
305    this.gpuFrequency = gpuFreq;
306    this.gpuLoad = gpuLoad;
307    this.ddrFrequency = ddrFreq;
308    this.shellFrameTemp = shellFrame;
309    this.shellFrontTemp = shellFront;
310    this.shellBackTemp = shellBack;
311    this.socThermalTemp = socThermal;
312    this.systemHTemp = systemH;
313    this.gpuTemp = gpu;
314    this.ambientTemp = ambient;
315    this.batteryTemp = battery;
316    this.currentNow = currentNow;
317    this.voltageNow = voltageNow;
318    this.pss = pss;
319    this.fps = fps;
320    this.fpsJitters = fpsJitters;
321    this.networkUpSpeed = networkUpSpeed;
322    this.networkDownSpeed = networkDownSpeed;
323  }
324
325  setTimeStamp(timestamp: String) {
326    this.timestamp = timestamp;
327  }
328
329  setTaskId(taskId: String) {
330    this.taskId = taskId;
331  }
332
333  setCPUData(
334    cpu0Freq: String,
335    cpu1Freq: String,
336    cpu2Freq: String,
337    cpu3Freq: String,
338    cpu4Freq: String,
339    cpu5Freq: String,
340    cpu6Freq: String,
341    cpu7Freq: String
342  ) {
343    this.cpu0Frequency = cpu0Freq;
344    this.cpu1Frequency = cpu1Freq;
345    this.cpu2Frequency = cpu2Freq;
346    this.cpu3Frequency = cpu3Freq;
347    this.cpu4Frequency = cpu4Freq;
348    this.cpu5Frequency = cpu5Freq;
349    this.cpu6Frequency = cpu6Freq;
350    this.cpu7Frequency = cpu7Freq;
351  }
352
353  setCPULoadData(
354    cpu0Load: String,
355    cpu1Load: String,
356    cpu2Load: String,
357    cpu3Load: String,
358    cpu4Load: String,
359    cpu5Load: String,
360    cpu6Load: String,
361    cpu7Load: String
362  ) {
363    this.cpu0Load = cpu0Load;
364    this.cpu1Load = cpu1Load;
365    this.cpu2Load = cpu2Load;
366    this.cpu3Load = cpu3Load;
367    this.cpu4Load = cpu4Load;
368    this.cpu5Load = cpu5Load;
369    this.cpu6Load = cpu6Load;
370    this.cpu7Load = cpu7Load;
371  }
372
373  setGPUData(gpuFreq: String, gpuLoad: String) {
374    this.gpuFrequency = gpuFreq;
375    this.gpuLoad = gpuLoad;
376  }
377
378  setDDRData(ddrFreq: String) {
379    this.ddrFrequency = ddrFreq;
380  }
381
382  setTempData(
383    shellFrame: String,
384    shellFront: String,
385    shellBack: String,
386    socThermal: String,
387    systemH: String,
388    gpu: String,
389    ambient: String
390  ) {
391    this.shellFrameTemp = shellFrame;
392    this.shellFrontTemp = shellFront;
393    this.shellBackTemp = shellBack;
394    this.socThermalTemp = socThermal;
395    this.systemHTemp = systemH;
396    this.gpuTemp = gpu;
397    this.ambientTemp = ambient;
398  }
399
400  setPowerData(currentNow: String, voltageNow: String, batteryTemp: String) {
401    this.currentNow = currentNow;
402    this.voltageNow = voltageNow;
403    this.batteryTemp = batteryTemp;
404  }
405
406  setFpsData(fps: String, fpsJitter: String) {
407    this.fps = fps;
408    this.fpsJitters = fpsJitter;
409  }
410
411  setRamData(pss: String) {
412    this.pss = pss;
413  }
414
415  setNetWorkData(networkUpSpeed: String, networkDownSpeed: String) {
416    this.networkDownSpeed = networkDownSpeed;
417    this.networkUpSpeed = networkUpSpeed;
418  }
419
420  setDefaultValue() {
421    let properties = Object.keys(this);
422    properties.forEach((property) => {
423      this[property] = '-1';
424    });
425  }
426}
427
428//dubai app功耗
429export class TPowerAppInfo {
430  //主键 自增
431  public id: String;
432  public taskId: String;
433  public application: String;
434  public power: String;
435  public current: String;
436  public percent: String;
437  public color: Resource;
438  constructor(
439    id?: String,
440    taskId?: String,
441    application?: String,
442    power?: String,
443    current?: String,
444    percent?: String,
445    color?: Resource
446  ) {
447    this.id = id;
448    this.taskId = taskId;
449    this.application = application;
450    this.power = power;
451    this.current = current;
452    this.percent = percent;
453    this.color = color;
454  }
455  setColor(color?: Resource) {
456    this.color = color;
457  }
458  setPower(power?: String) {
459    this.power = power;
460  }
461  setPercent(percent?: String) {
462    this.percent = percent;
463  }
464  setCurrent(current?: String) {
465    this.current = current;
466  }
467}
468
469//dubai 器件功耗
470export class TPowerSensorInfo {
471  //主键 自增
472  public id: string;
473  public taskId: string;
474  public sensor: string;
475  public power: string;
476  public current: string;
477  public percent: string;
478  public color: Resource;
479  constructor(taskId?: string, sensor?: string, power?: string, current?: string, percent?: string, color?: Resource) {
480    this.taskId = taskId;
481    this.sensor = sensor;
482    this.power = power;
483    this.current = current;
484    this.percent = percent;
485    this.color = color;
486  }
487  setPerenct(percent: string) {
488    this.percent = percent;
489  }
490  setColor(color: Resource) {
491    this.color = color;
492  }
493  setPower(power: string) {
494    this.power = power;
495  }
496  setCurrent(current: string) {
497    this.current = current;
498  }
499}
500