From e529e8e507b2a28fa9f7e12c783ad0341f318392 Mon Sep 17 00:00:00 2001 From: likunhui Date: Thu, 14 Dec 2023 14:47:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9F=BA=E7=BA=BF?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E5=AF=B9=E6=AF=94=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: likunhui --- .../Benchmark/build-profile.json5 | 4 +-- .../src/ohosTest/ets/test/Index.test.ets | 9 ++++++- .../arkui/benchmark_pipeline/README.md | 18 ++++++++++--- .../arkui/benchmark_pipeline/benchmark.bat | 6 ++--- .../benchmark_pipeline_report.html | Bin 23040 -> 24064 bytes .../arkui/benchmark_pipeline/bytrace.bat | 3 ++- performance/arkui/benchmark_pipeline/test.bat | 2 +- .../benchmark_pipeline/traceParseFile.py | 25 +++++++++++++++--- 8 files changed, 53 insertions(+), 14 deletions(-) diff --git a/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 b/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 index b8fa006f..bdfc3e88 100644 --- a/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 +++ b/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 @@ -21,9 +21,9 @@ "type": "HarmonyOS", "material": { "certpath": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.cer", - "storePassword": "0000001A8B84254F56DEBBB02E7D698F0FED83DBFA69347BBBB1C1DABCFE6B630D2A20C2C0215560CA4B", + "storePassword": "0000001A61C9AAB1D34D4683D01A84952C62F8FDA60704162E3C3277EB16A657072CC0AFCBE8F75FD151", "keyAlias": "debugKey", - "keyPassword": "0000001A5DD9164C6B958A05D9A532352F07A012659A36A9BBDC5A26847736547F873912B137D7E0DBF0", + "keyPassword": "0000001A32C6990C4CA92032D943A1CCA53077CC0EE6074F63A3ECB627E672D2ADDD249C8C2A8E5C59E4", "profile": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.p7b", "signAlg": "SHA256withECDSA", "storeFile": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.p12" diff --git a/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets b/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets index 26606a13..2278376f 100644 --- a/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets +++ b/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets @@ -27,6 +27,10 @@ async function startApp() { await abilityDelegatorRegistry.getAbilityDelegator().startAbility(want) } +function sleep(time: number) { + return new Promise((resolve: Function) => setTimeout(resolve, time)); +} + // 通用测试case async function commonTestCase(pageBtnId: string, compId: string) { // 启动App @@ -36,6 +40,9 @@ async function commonTestCase(pageBtnId: string, compId: string) { await driver.delayMs(5000) // 延迟1s // 点击跳转用例页面 let bk = await driver.findComponent(ON.id(pageBtnId)) + while (bk == null) { + bk = await driver.findComponent(ON.id(pageBtnId)) + } await bk.click() // 跳转页面耗时 await driver.delayMs(1000) @@ -50,7 +57,7 @@ async function commonTestCase(pageBtnId: string, compId: string) { await firstBtn.click() } // **当前页面跳转or显示有转场动画时间or按钮点击事件处理,需要延迟** - await driver.delayMs(2000) + await driver.delayMs(3000) } export default function IndexTest() { diff --git a/performance/arkui/benchmark_pipeline/README.md b/performance/arkui/benchmark_pipeline/README.md index 47b295e8..bb5ca875 100644 --- a/performance/arkui/benchmark_pipeline/README.md +++ b/performance/arkui/benchmark_pipeline/README.md @@ -1,4 +1,5 @@ # 工程目录结构 + ``` ├── Benchmark     // 场景用例Sample及ohosTest ├── pip             // python安装读写Excel插件的配置文件 @@ -14,6 +15,15 @@ > **benchmark_pipeline_report.html 需把html后缀改为xls** +# 前期准备 + +### 设备 + +> 1、手机要求Mate 60或同等级设备及以上 +> +> 2、系统要求ALN-AL00 + +### 锁频锁核 # 安装python最新版,至少3.x以上 @@ -43,12 +53,14 @@ > 说明: > -> 1、确保所有工具和【渲染管线报告.xls】处于同一目录下; +> 1、确保所有工具和【benchmark_pipeline_report.xls】处于同一目录下; > > 2、如果选择1,则自动运行全部用例,中间无需做其他操作;如果选择2只可以运行具体某用例; > -> 3、无论选择1还是2,耗时时间都会自动写入【渲染管线报告.xls】; +> 3、无论选择1还是2,耗时时间都会自动写入【benchmark_pipeline_report.xls】; +> +> 4、工具会自动比对,耗时时间小于基线时间或者不大于基线时间10%均为Pass,否则Fail > -> 4、在运行用例时,禁止打开【渲染管线报告.xls】,否则耗时时间无法写入。 +> 5、在运行用例时,禁止打开【渲染管线报告.xls】,否则耗时时间无法写入。 > > ![图片6](https://gitee.com/kunge-hub/ostest_integration_test/raw/benchmark_pipeline/performance/arkui/benchmark_pipeline/screenshot/image6.png) diff --git a/performance/arkui/benchmark_pipeline/benchmark.bat b/performance/arkui/benchmark_pipeline/benchmark.bat index a4986cdd..03b1e10f 100644 --- a/performance/arkui/benchmark_pipeline/benchmark.bat +++ b/performance/arkui/benchmark_pipeline/benchmark.bat @@ -42,8 +42,8 @@ echo ------------------ echo 15Columnа100buttonbuttonıbutton֡FlushDirtyNodeUpdate echo 16Columnа100buttonʹԶbuttonıbutton֡FlushDirtyNodeUpdate echo ------------------ -echo 17Columnа100buttonbuttonΪɼHandleVisibleAreaChangeEvent -echo 18Columnа100buttonʹԶbuttonΪɼHandleVisibleAreaChangeEvent +echo 17Columnа100buttonԻײHandleVisibleAreaChangeEvent +echo 18Columnа100buttonʹԶԻײHandleVisibleAreaChangeEvent echo ------------------ echo 19Columnа100buttonbuttonıbuttonߡHandleOnAreaChangeEvent echo 20Columnа100buttonʹԶbuttonıbuttonߡHandleOnAreaChangeEvent @@ -146,5 +146,5 @@ if not exist %tracefolder% (mkdir %tracefolder%) ::Զbytrace start cmd /c test.bat %testname% -timeout -nobreak 3 +timeout -nobreak 5 start cmd /c bytrace.bat %filename% %tracefolder% %tagname% %rownum% %mode% %isAuto% \ No newline at end of file diff --git a/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html b/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html index 33d4699ba5e7bb9f08f4977f66a31b957f43aa3f..3602bab736a4e86d720e5951e20873752afb59b3 100644 GIT binary patch delta 5225 zcmcJTeQZ={Hlh}#lI8GqWCpbxqlRB`HKoba%wi;~^WvXa3IuIKg z!Dd=JjetgT`bUL;rdlhcRck@%n5eoCs%cv%?MpDRQE6(mb<$KiZJO9<2W02m_iSP( zg})Z-z3X$%z2|q&J?Gx{ob1~o`>r_NCz{SZ@N*$r(5PT_BLKwcy0fsbz*jSUUy+l~ zjSh)v^_kMd`(@|1t-L1UWXR$HHKRN>jGwEA#5Fu%{HCzu4P%GX1Y#JTqR-Rt2y6!I zH*LcaQwhFo>Ql3OZYA&!rZ>@Ij^I9X0(V-<(QYlrKDu5bd6?uY=5OFZ%W;fYU9&r_ z#|>pQsu#|J8ALs_Ks|jD@C1Zr|7Cw(RG1+SHx^s~Hvv+iR0v=`^db1bf-kxQ!ipa` z1Hz0iI{1Ex?iRe{4z!g}0CLpZ`Y3gU9A$>)Wxd&W6vg*XM}UadW&4z}l_+5%+HivU zJ6MAsI<5Gb!zoP?{j3e<*fO*x}-IL{bViAS+BrEDwH5mTdNABv7!=RrMm@3JNrc12jG@)Tfm}X$`=wQ6uvIp<@0UL8wD9dxrH!F7c}UmTP!Xn-SrZ^k;+no zxZT_zZ+e5R2Q5B0XdzGezb){$V>ho)S}I_&Ku=W*0>f41!j0FfJMo7B7yiSi;-$c0 zyzT43rYe{4V_QvHl;MraPJi+EKz@8V?yu>@gJmv!ysQLA{edNYD`np&{pF$x5BL)z zh(GY}!BCCMQB4*DsI+Gc(B6SF!A3k7Xk%xh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_gu+?^cbhY7Plwj(HdCPYEnUh7fuUWT>Xr8V=<^kk@8oWZr8QR>)z zvfe4JpX^ofXI<%)?Y%L-?a49x>W(qr;J-U~o2=0&Wmpb8<0mVlO;5=7@(z4DW}w%!4iR=YY@zv++lL6e8~QAz9cCeKaS8#q634-WD44z0 z%nOmF4{r*DJQV%a`W%VPgMFxVqon zOW_)S8!1Uw*9;ZWi~r+kWH$~D%NLC?Bp;yjF-0e4gzZo} YoM`N)x!OvfyrhGKD$rNkBXghqAM;oB)c^nh diff --git a/performance/arkui/benchmark_pipeline/bytrace.bat b/performance/arkui/benchmark_pipeline/bytrace.bat index ee3dd80f..4571a170 100644 --- a/performance/arkui/benchmark_pipeline/bytrace.bat +++ b/performance/arkui/benchmark_pipeline/bytrace.bat @@ -16,7 +16,8 @@ hdc shell "bytrace -t 10 -b 40960 --overwrite ability ace graphic > /data/%filen hdc shell "sed -i '1,2d' /data/%filename%" hdc file recv /data/%filename% ./%tracefolder%/%filename% :: -python3 traceParseFile.py --ftrace %tracefolder%/%filename% --tags %tagname% --ofile Ⱦ߱.xls --ofilePos %rownum%,6 +python3 traceParseFile.py --ftrace %tracefolder%/%filename% --tags %tagname% --ofile benchmark_pipeline_report.xls --ofilePos %rownum%,6 + ::ӳ1 timeout -nobreak 1 diff --git a/performance/arkui/benchmark_pipeline/test.bat b/performance/arkui/benchmark_pipeline/test.bat index 0e6c14a2..5ef0d4fc 100644 --- a/performance/arkui/benchmark_pipeline/test.bat +++ b/performance/arkui/benchmark_pipeline/test.bat @@ -12,4 +12,4 @@ :: limitations under the License. ::Զ -hdc shell aa test -b com.example.benchmark -m entry_test -s unittest OpenHarmonyTestRunner -s class IndexTest#%1 -s timeout 150000 \ No newline at end of file +hdc shell aa test -b com.example.benchmark -m entry_test -s unittest /ets/testrunner/OpenHarmonyTestRunner -s itName %1 -s timeout 60000 \ No newline at end of file diff --git a/performance/arkui/benchmark_pipeline/traceParseFile.py b/performance/arkui/benchmark_pipeline/traceParseFile.py index 2967cd6f..f5eee373 100644 --- a/performance/arkui/benchmark_pipeline/traceParseFile.py +++ b/performance/arkui/benchmark_pipeline/traceParseFile.py @@ -82,7 +82,7 @@ flushMessagesMaxDuration=0 #读取读取文件 -with open(ftraceFile) as file: +with open(ftraceFile, 'r', errors='ignore') as file: for item in file: #在ftrace中是多进程一起记录,故各个进程必须独立解析 #初步判断是当前任务 @@ -189,8 +189,27 @@ if(len(tagDict)==1): new_workbook = copy(workbook) write_save = new_workbook.get_sheet(0) outExcelFilePosArr=outExcelFilePosition.split(",") - - write_save.write(int(outExcelFilePosArr[0]), int(outExcelFilePosArr[1]), str(completeTagsDict[tagOri])+"μs") + row=int(outExcelFilePosArr[0]) + column=int(outExcelFilePosArr[1]) + # 测试数据 + test_data=completeTagsDict[tagOri] + write_save.write(row, column, test_data) + + # 读取基线数据 + work_sheet=workbook.sheets()[0] + base_line_data=int(work_sheet.cell_value(row, column-1)) + # 测试数据与基线数据比对并写入结果 + result="Pass" + # 如果测试数据大于基线数据 + if(test_data>base_line_data): + # 不大于10%也算通过 + if(((test_data-base_line_data)/base_line_data)<=0.1): + result="Pass" + else: + result="Fail" + write_save.write(row, column+1, result) + + print("test_data=%d, base_line_data:%d, comparison_result=%s" % (test_data,base_line_data,result)) new_workbook.save(tempFileName) workbook.release_resources() -- Gitee From eb4c621970d7be040d0c7e84610ea2c3f548ba75 Mon Sep 17 00:00:00 2001 From: likunhui Date: Thu, 14 Dec 2023 15:38:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=94=81=E9=A2=91=E9=94=81=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: likunhui --- performance/arkui/benchmark_pipeline/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/performance/arkui/benchmark_pipeline/README.md b/performance/arkui/benchmark_pipeline/README.md index bb5ca875..7b405a08 100644 --- a/performance/arkui/benchmark_pipeline/README.md +++ b/performance/arkui/benchmark_pipeline/README.md @@ -25,6 +25,10 @@ ### 锁频锁核 +> [脚本地址下载](wiki.huawei.com/domains/1456/wiki/8/WIKI20220906294838) +> +> 使用方法按上面wiki文档说明操作即可 + # 安装python最新版,至少3.x以上 # 运行`xlpip.bat` 安装python插件 -- Gitee From 686d884541bafa8195c46a806de43e263adb1788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B2=B2=E8=BE=89?= Date: Thu, 14 Dec 2023 07:47:02 +0000 Subject: [PATCH 3/3] update README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李鲲辉 --- performance/arkui/benchmark_pipeline/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance/arkui/benchmark_pipeline/README.md b/performance/arkui/benchmark_pipeline/README.md index 7b405a08..763255dd 100644 --- a/performance/arkui/benchmark_pipeline/README.md +++ b/performance/arkui/benchmark_pipeline/README.md @@ -25,7 +25,7 @@ ### 锁频锁核 -> [脚本地址下载](wiki.huawei.com/domains/1456/wiki/8/WIKI20220906294838) +> [脚本地址下载](https://wiki.huawei.com/domains/1456/wiki/8/WIKI20220906294838) > > 使用方法按上面wiki文档说明操作即可 -- Gitee