1 /*
2  * Copyright (c) 2024 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 #ifndef I_JANK_ANIMATOR_REPORTER_INFRASTRUCTURE_H
17 #define I_JANK_ANIMATOR_REPORTER_INFRASTRUCTURE_H
18 
19 #include <string>
20 
21 struct JankAnimatorReportData {
22     int32_t appPid{0};
23     int32_t versionCode{0};
24     std::string versionName{""};
25     std::string bundleName{""};
26     std::string processName{""};
27     std::string abilityName{""};
28     std::string pageUrl{""};
29     std::string sceneId{""};
30     std::string bundleNameEx{""};
31     bool isFocus;
32     uint64_t startTime{0};
33     uint64_t durition{0};
34     int32_t totalAppFrames{0};
35     int32_t totalAppMissedFrames{0};
36     uint64_t maxAppFrameTime{0};
37     int32_t maxAppSeqMissedFrames{0};
38     bool isDisplayAnimator{false};
39     int32_t totalRenderFrames{0};
40     int32_t totalRenderMissedFrames{0};
41     uint64_t maxRenderFrameTime{0};
42     float averageRenderFrameTime{0};
43     int32_t maxRenderSeqMissedFrames{0};
44     bool isFoldDisp{false};
45     /* only for critical */
46     std::string traceFileName{""};
47     std::string infoFileName{""};
48     uint64_t happenTime{0};
49 };
50 
51 class IJankAnimatorReportInfrastructure {
52 public:
53     virtual void ReportNormal(const JankAnimatorReportData& data) = 0;
54     virtual void ReportCritical(const JankAnimatorReportData& data) = 0;
55 };
56 
57 #endif // I_JANK_ANIMATOR_REPORTER_INFRASTRUCTURE_H