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