- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在研究从 profiler.out 文件中检索测试代码覆盖率数据的脚本。现在生成这个文件不是什么大问题。但我似乎无法理解这个文件的内容与被触发的测试有何关系(对我来说,这些看起来就像随机数字和字符串)...
有人知道这些数字代表什么吗?
我生成了一个示例分析器文件(源语言是 Progress),如下所示:
提前致谢!
雅各
最佳答案
OpenEdge Profiler 的文档“很少”。如果你搜索 Progress kbase,它会出现几个条目,最终导致: https://community.progress.com/community_groups/openedge_general/w/openedgegeneral/1980.profiler-control-tool
这是旧的不受支持的独立“分析器控制工具”(该工具不受支持,支持分析器启动选项和 session 句柄)。
在该页面链接到的 zip 文件中是唯一已知的探查器输出格式文档。
当前的 OpenEdge 11 IDE (PDSOE) 直接支持分析器分析工具。
下面的代码不是很漂亮,但它是一个独立的工具,可以读取分析器输出文件(我更喜欢将它们命名为“something.prf”而不是“profiler.out”)并生成报告最耗时的代码行:
/* zprof_topx.p
*
* process a .prf file and produce a report
*
* pro -p lib/zprof_topx.p -param tmp/f03e40c9-8043-0aba-e611-3cc5eac467bd.2016.12.18.11.12.14
*
* note: there is no ".prf" at the end of the file name!
*
*/
define variable zprofData as character no-undo.
define variable topLines as integer no-undo initial 20.
define temp-table tt_profile
field id as integer format ">>>>9"
field pdate as date format "99/99/99"
field description as character format "x(30)"
index profile-idx is unique primary
id
index profile-date
pdate
.
define temp-table tt_source
field id as integer format ">>>>9"
field pid as integer format ">>>>>9"
field pname as character format "x(40)"
field debug_name as character format "x(40)"
index source-idx is unique primary
id pid
index source-name
pname
.
define temp-table tt_tree
field id as integer format ">>>>9"
field caller as integer format ">>>>>9"
field src_line as integer format ">>>>>9"
field callee as integer format ">>>>>9"
field call_count as integer format ">>>>>9"
index tree-idx is primary
id caller src_line callee
.
define temp-table tt_ptime
field id as integer format ">>>>9"
field pid as integer format ">>>>>9"
field src_line as integer format ">>>>>9"
field exec_count as integer format ">>>>>>>>>9"
field exe_time as decimal format ">>>>>9.999999"
field tot_time as decimal format ">>>>>9.999999"
field avg_time as decimal format ">>>>>9.999999"
index ptime-idx is unique primary
id pid src_line
index avg-idx
avg_time descending
index line-idx
src_line
index ptime-pid-t1
id pid exe_time
index ptime-pid-t3
id pid avg_time
index ptime-t1
id exe_time
index ptime-t3
id avg_time
.
define temp-table tt_code_line
field pid as integer format ">>>>>9" /* program id# */
field src_line as integer format ">>>>9" /* source line# */
field pname as character format "x(30)" /* procedure or class name */
field ipname as character format "x(40)" /* internal procedure or method name */
field t1 as decimal format ">>>>>9.999999" /* execution time */
field t2 as integer format ">>>>>>>>>9" /* calls */
field t3 as integer format ">>9" /* sessions */
field t4 as decimal format ">>>>>9.999999" /* average time */
index bad-idx1 is unique primary
pid pname src_line
index bad-idx2
t2 t3
index bad-idx3
t1
index avg-idx
t4
.
/*********************************************************/
define stream inStrm.
procedure zprofiler_load:
define input parameter zprofData as character no-undo.
define variable i as integer no-undo.
define variable v as integer no-undo.
define variable dt as date no-undo.
define variable dsc as character no-undo.
define variable profile_id as integer no-undo.
empty temp-table tt_profile.
empty temp-table tt_source.
empty temp-table tt_tree.
empty temp-table tt_ptime.
file-info:file-name = zprofData + ".prf".
if file-info:full-pathname = ? then
do:
message "Cannot find profiler .prf data file:" zprofData.
pause.
return.
end.
/* message "loading from:" file-info:full-pathname. /* session:date-format. */ pause. */
input stream inStrm from value( file-info:full-pathname ).
i = 1.
repeat: /* in theory there could be more than 1? that would probably break a lot of stuff... */
import stream inStrm v /* dt */ ^ dsc no-error. /* the profiler apparently ignores session:date-format... */
if v <> 1 then
do:
input stream inStrm close.
message "Invalid version:" v.
pause.
return.
end.
/* message v dt dsc. pause. */ /* the profiler apparently ignores session:date-format... */
profile_id = i.
create tt_profile.
assign
tt_profile.id = profile_id
tt_profile.pdate = today /* dt */
tt_profile.description = dsc
.
i = i + 1.
end.
/* message "profile id:" profile_id. pause. */
i = 1.
repeat:
create tt_source.
tt_source.id = profile_id.
import stream inStrm tt_source.pid tt_source.pname tt_source.debug_name no-error.
i = i + 1.
end.
/* message i "tt_source loaded". pause.
* message "creating tt_source session record". pause.
*/
/* create tt_source. */ /* don't CREATE -- an extra will be left over from the REPEAT logic */
assign
tt_source.id = profile_id
tt_source.pid = 0
tt_source.pname = "Session"
tt_source.debug_name = "Session"
.
/* message "tt_source session record created". pause. */
i = 1.
repeat:
create tt_tree.
tt_tree.id = profile_id.
import stream inStrm tt_tree.caller tt_tree.src_line tt_tree.callee tt_tree.call_count no-error.
i = i + 1.
end.
delete tt_tree.
/* message i "tt_tree loaded". pause. */
i = 1.
repeat:
create tt_ptime.
tt_ptime.id = profile_id.
import stream inStrm tt_ptime.pid tt_ptime.src_line tt_ptime.exec_count tt_ptime.exe_time tt_ptime.tot_time no-error.
tt_ptime.avg_time = tt_ptime.exe_time / tt_ptime.exec_count.
i = i + 1.
end.
delete tt_ptime.
/* message i "tt_ptime loaded". pause. */
input stream inStrm close.
return.
end.
procedure zprofiler_proc:
define variable c as integer no-undo.
define variable i as integer no-undo.
define variable t1 as decimal no-undo format ">>>>>9.999999".
define variable t2 as integer no-undo format ">>>>>>>>>9".
define variable t3 as integer no-undo format ">>9".
define variable srcName as character no-undo.
define variable iprocName as character no-undo.
empty temp-table tt_code_line.
for each tt_ptime no-lock by tt_ptime.avg_time descending:
/* if exec_count < 1 /* or src_line = 0 */ then next. */
find tt_source where
tt_source.id = tt_ptime.id and
tt_source.pid = tt_ptime.pid no-error.
if not available( tt_source ) then
srcName = "session".
else
srcName = tt_source.pname.
if srcName begins "lib/zprof" then next. /* don't include the profiler */
find tt_code_line where
tt_code_line.pid = tt_ptime.pid and
tt_code_line.src_line = tt_ptime.src_line and
tt_code_line.pname = srcName /* tt_source.pname */ no-error.
if not available tt_code_line then
do:
create tt_code_line.
assign
i = i + 1
tt_code_line.pid = tt_ptime.pid
tt_code_line.src_line = tt_ptime.src_line
tt_code_line.pname = srcName
.
end.
end.
/* message i "entries processed". pause. */
for each tt_code_line:
assign
tt_code_line.t1 = 0
tt_code_line.t2 = 0
.
for
each tt_source where
tt_source.pname = tt_code_line.pname,
each tt_ptime where
tt_ptime.id = tt_source.id and
tt_ptime.pid = tt_source.pid and
tt_ptime.src_line = tt_code_line.src_line:
assign
tt_code_line.t1 = tt_code_line.t1 + tt_ptime.exe_time
tt_code_line.t2 = tt_code_line.t2 + tt_ptime.exec_count
tt_code_line.t3 = tt_code_line.t3 + 1
.
if tt_ptime.pid = 0 and tt_ptime.src_line = 0 then tt_code_line.t1 = tt_ptime.tot_time.
end.
end.
for each tt_code_line:
tt_code_line.t4 = ( tt_code_line.t1 / tt_code_line.t2 ). /* calculate the average time... */
if num-entries( tt_code_line.pname, " " ) > 1 then
assign
tt_code_line.ipname = entry( 1, tt_code_line.pname, " " )
tt_code_line.pname = entry( 2, tt_code_line.pname, " " )
.
end.
return.
end.
procedure zprofiler_topx:
define input parameter zprofData as character no-undo.
define input parameter toTTY as logical no-undo.
define input parameter topLines as integer no-undo.
define variable c as integer no-undo.
define variable i as integer no-undo.
define variable t1 as decimal no-undo format ">>>>>9.999999".
define variable t2 as integer no-undo format ">>>>>>>>>9".
define variable t3 as integer no-undo format ">>9".
define variable t9 as integer no-undo.
find first tt_profile no-lock no-error. /* assuming that they're all the same date... */
for each tt_code_line no-lock where tt_code_line.pname <> "session":
t9 = t9 + tt_code_line.t1.
end.
if toTTY = no then output to value( zprofData + ".rpt" ).
display
tt_profile.description label "Description" format "x(70)" skip
"Session Total Execution Time " string( t9, "hh:mm:ss" ) skip
"Line 0 = initialization, line -1 = cleanup" skip
with frame prof-hdr
title " Profiler: Top Results "
width 120
centered
overlay
side-labels
row 4
.
i = 0.
for each tt_code_line no-lock by tt_code_line.t1 descending:
if tt_code_line.pname = "session" then next.
i = i + 1.
display
tt_code_line.pname label "Program/Class"
tt_code_line.src_line label "Line"
tt_code_line.t1 label "Time"
tt_code_line.t4 label "Avg Time"
tt_code_line.t2 label "Calls"
tt_code_line.ipname label "Internal Procedure/Method"
with frame prof-rpt
title " Top Lines: Total Execution Time "
width 120
centered
overlay
down
row 9
.
if i > topLines then leave.
end.
if toTTY = no then
output close.
else
do:
pause.
hide frame prof-rpt.
hide frame prof-hdr.
end.
return.
end.
/* main body
*
*/
zprofData = entry( 1, session:parameter, "|" ).
if num-entries( session:parameter, "|" ) = 2 then topLines = integer( entry( 2, session:parameter, "|" )).
run zprofiler_load( zprofData ). /* load profiler data into temp-tables to analyze */
run zprofiler_proc. /* process the data */
run zprofiler_topx( zprofData, no, topLines ). /* report on the top X execution time lines -- to file */
if session:batch = no then
run zprofiler_topx( zprofData, yes, topLines ). /* report on the top X execution time lines -- to TTY */
quit.
关于code-coverage - profiler.out 内容代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53958452/
在 Python 2.7 和 Python 3.6 中,我发现这有效: from cProfile import Profile; p = Profile(); p.enable() ...而这引发了
我正在尝试在 Windows 8 PRO 64 位上的 Visual Studio 2012 RTM 中为控制台程序启动性能分析 session (分析/启动性能分析)。 我收到一条弹出消息通知我 C
我在 windows 上有一个应用程序,它在单声道上运行得很好。但是,当我尝试对其进行分析时: mono --profile=log program.exe 我得到: The 'log' profil
我正在尝试使用 Django 创建注册表单。我在提交表单时收到此错误。 这就是我所做的。 models.py from django.db import models from django.cont
是否可以从 Flash Builder 导出分析结果? 我需要它们,因为我想根据方法名称进行过滤,但 Flash Builder 的内置过滤不允许这样做。 最佳答案 它隐藏在 GUI 的一个完全隐蔽、
我真的很喜欢热图,但我需要的是热图背后的数字(又名相关矩阵)。 有没有简单的方法来提取数字? 最佳答案 从文档开始追踪有点困难;具体来说 来自 report structure然后深入研究以下函数 g
我有一个 POM,它声明了我的项目常见的 Web 应用程序内容。我将它用作所有 Web 应用程序的父级。 是否可以仅在包装为 war 时激活配置文件?我已经尝试过属性方法,但这不起作用(因为它不是系统
在数据帧上运行 pandas-profiling 时,我看到它将索引分析为一个变量。注意:我的索引是唯一键(命名为UUID) 有没有办法排除引入索引上报? 我知道我可以在 pandas 中删除它,但在
在数据帧上运行 pandas-profiling 时,我看到它将索引分析为一个变量。注意:我的索引是唯一键(命名为UUID) 有没有办法排除引入索引上报? 我知道我可以在 pandas 中删除它,但在
我正在使用 Intel Vtune 来分析需要在另一台机器上进行 sudo 访问的远程应用程序。之前我已经能够在不需要 sudo 访问的那台机器上分析远程应用程序,但英特尔 Vtune 不适用于需要
我已经在我的 MVC 4 应用程序上安装了 Mini-Profiler,它运行得非常棒。我遇到的唯一问题是 UI 覆盖了我 UI 的关键部分。我可以使用 css 在页面上移动它,但理想情况下我想这样做
在使用 Chrome devtools 分析堆快照时,我似乎无法弄清楚查看分离的 DOM 树时颜色的含义。红色和黄色有什么区别? 最佳答案 有很好的解释available here . 从文章: Re
分析器中 SQL Server 跟踪的输出包含 CPU 和持续时间列(以及其他列)。这些值的单位是什么? 最佳答案 CPU 以毫秒为单位。在 sql server 2005 及更高版本中,保存到文件或
我有一个奇怪的问题,我正在使用 MiniProfiler,它很棒,在我的本地机器上没有任何问题,但它在我们的测试服务器上的表现似乎有所不同。它似乎会生成许多对 mini-profiler-resour
我想知道优先级 的application-{profile}.properties文件,如果有多个 spring.profiles.active添加。 例如: 比方说,我有这个 spring.prof
我有一个名为“isActive”的助手和一个名为“create”的模板.. 见下文 Template.create.isActive = function () { return Meteor.u
这是我面临的场景:我正在使用 MiniProfiler 来分析一些操作。但它缺少我必须使用的特定功能。有一个设置文件 MiniProfiler 可以让我做一些配置,比如分析什么考虑什么,什么不考虑,什
哇,这完全令人困惑,而且 dojo 1.8 文档似乎是围绕构建层的完整 clusterf**k。有人知道那里发生了什么吗? 在构建脚本示例配置文件中,示例 amd.profile.js 有 profi
我正在为一个内部项目使用出色的 MVC Mini Profiler,但希望它能够显示时间信息,无论您是谁。理想情况下,如果用户是站点的管理员或开发人员,我希望能够显示完整的分析信息,如果用户只是标准用
打开Android Profiler编译出现如下错误: FAILURE:构建失败并出现异常。 什么地方出了错: Execution failed for task ':app:transformCla
我是一名优秀的程序员,十分优秀!