1 /* 2 * Copyright (c) 2025 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 #ifndef OHOS_ABILITY_RUNTIME_CPU_DATA_PROCESSOR_H 16 #define OHOS_ABILITY_RUNTIME_CPU_DATA_PROCESSOR_H 17 18 #include <vector> 19 #include <string> 20 21 #include "appfreeze_data.h" 22 23 namespace OHOS { 24 namespace AppExecFwk { 25 class CpuDataProcessor { 26 public: CpuDataProcessor()27 CpuDataProcessor() {}; 28 CpuDataProcessor(const std::vector<std::vector<CpuFreqData>> &cpuData, 29 const std::vector<TotalTime> &totalTimeList, CpuStartTime cpuStartTime, 30 const std::string &stackPath, int32_t pid); 31 ~CpuDataProcessor() = default; 32 33 std::vector<std::vector<CpuFreqData>> GetHandlingHalfCpuData() const; 34 std::vector<TotalTime> GetTotalTimeList() const; 35 CpuStartTime GetCpuStartTime() const; 36 std::string GetStackPath() const; 37 int32_t GetPid() const; 38 39 private: 40 std::vector<std::vector<CpuFreqData>> handlingHalfCpuData_; 41 std::vector<TotalTime> totalTimeList_; 42 CpuStartTime cpuStartTime_ {}; 43 std::string stackPath_; 44 int32_t pid_ = 0; 45 }; 46 } // namespace AppExecFwk 47 } // namespace OHOS 48 #endif // OHOS_ABILITY_RUNTIME_CPU_DATA_PROCESSOR_H 49