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