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 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
18 
19 #include <string>
20 
21 #include "base/utils/macros.h"
22 
23 namespace OHOS::Ace {
24 class ACE_EXPORT AceChecker final {
25 public:
26     static bool IsPerformanceCheckEnabled();
27 
28     static void NotifyCaution(const std::string& tag);
29 
30     static void InitPerformanceParameters();
31 
GetPageNodes()32     static int32_t GetPageNodes()
33     {
34         return pageNodes_;
35     }
36 
GetPageDepth()37     static int32_t GetPageDepth()
38     {
39         return pageDepth_;
40     }
41 
GetNodeChildren()42     static int32_t GetNodeChildren()
43     {
44         return nodeChildren_;
45     }
46 
GetFunctionTimeout()47     static int32_t GetFunctionTimeout()
48     {
49         return functionTimeout_;
50     }
51 
GetVsyncTimeout()52     static int32_t GetVsyncTimeout()
53     {
54         return vsyncTimeout_;
55     }
56 
GetNodeTimeout()57     static int32_t GetNodeTimeout()
58     {
59         return nodeTimeout_;
60     }
61 
GetForeachItems()62     static int32_t GetForeachItems()
63     {
64         return foreachItems_;
65     }
66 
GetFlexLayouts()67     static int32_t GetFlexLayouts()
68     {
69         return flexLayouts_;
70     }
71 
72 private:
73     static int32_t pageNodes_;
74     static int32_t pageDepth_;
75     static int32_t nodeChildren_;
76     static int32_t functionTimeout_;
77     static int32_t vsyncTimeout_;
78     static int32_t nodeTimeout_;
79     static int32_t foreachItems_;
80     static int32_t flexLayouts_;
81 };
82 } // namespace OHOS::Ace
83 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
84