美文网首页
第四十二章 使用^%SYS.MONLBL检查例程性能 - 逐行分

第四十二章 使用^%SYS.MONLBL检查例程性能 - 逐行分

作者: Cache技术分享 | 来源:发表于2023-01-12 07:50 被阅读0次

    第四十二章 使用^%SYS.MONLBL检查例程性能 - 逐行分隔输出报告

    Line-by-line Delimited Output Report

    此示例报告所选日志实用程序的最小指标的分隔详细信息。报告被发送到 monlbl_JRN_csv.txt 文件,显示其中的一部分:

    Line-by-Line Monitor
    
    1.) Stop Monitor
    2.) Pause Monitor
    3.) Clear Counters
    4.) Report - Detail
    5.) Report - Summary
    6.) Report - Delimited (CSV) Output
    7.) Report - Procedure Level
    
    Enter the number of your choice: 6
    
    The following routines have been executed during the run,
    and have detail statistics available for them.
    1) JRNDUMP
    2) JRNOPTS
    3) JRNSTART
    4) JRNSWTCH
    5) JRNUTIL
    6) JRNUTIL2
    
    Enter list of routines, or * for all
    Routine number (*=All)? * - All
    FileName: monlbl_JRN_csv.txt
    
    Press RETURN to continue ...
    
    

    对于所选例程的每一行,报告显示行、例程名称、行号、每个指标的计数以及该行代码的文本(如果源代码可用)均以逗号分隔。源代码行包含在引号内。

    Row,Routine,Line,RtnLine,Time,TotalTime,Code
    1,JRNDUMP,1,0,0,0,"JRNDUMP ;dump the contents of a journal file ; 
    ,2,0,0,0," /*"
    .
    .
    .
    85,JRNDUMP,85,0,0,0," n (l,usecluster)"
    86,JRNDUMP,86,3,0.000016,0.000016," i +$g(usecluster) d showlistclu(.l) q"
    87,JRNDUMP,87,3,0.000008,0.000008," s diroff=((3+12+1)+10+1)"
    88,JRNDUMP,88,3,0.000072,0.000072," s i="""" f  s i=$o(l(i)) q:i=""""  d"
    89,JRNDUMP,89,11,0.001542,0.001542," . w /cup(i+3,1),?3,$S($F(l(i),"";""):$E(l(i),...
    90,JRNDUMP,90,11,0.028125,0.028220," . w ?(3+12+1),l(i,""info""),?diroff...
    91,JRNDUMP,91,11,0.000378,0.000895," . w $$GJrnPrefix(l(i))"
    92,JRNDUMP,92,3,0.000027,0.000027," q"
    93,JRNDUMP,93,0,0,0,"listjrn(f,list,n) ;list at most n journal files...
    .
    
    

    这是一个选定例程的部分显示。

    Line-by-line Procedure Level Report 逐行程序级别报告

    以下是通过子例程函数报告所选日志实用程序的最小指标详细信息的示例。报告被发送到 monlbl_JRN_proc.txt 文件,其中显示了一部分。

    Line-by-Line Monitor
    
    1.) Stop Monitor
    2.) Pause Monitor
    3.) Clear Counters
    4.) Report - Detail
    5.) Report - Summary
    6.) Report - Delimited (CSV) Output
    7.) Report - Procedure Level
    
    Enter the number of your choice: 7
    
    The following routines have been executed during the run,
    and have detail statistics available for them.
    1) JRNDUMP
    2) JRNOPTS
    3) JRNSTART
    4) JRNSWTCH
    5) JRNUTIL
    6) JRNUTIL2
    
    Enter list of routines, or * for all
    Routine number (*=All)? * - All
    FileName: monlbl_JRN_proc.txt
    
    Press RETURN to continue ...
    
    

    对于所选例程的每个子例程,报告会显示标签号、每个指标的计数和子例程标签(如果源代码可用)。

    Routine ^JRNDUMP ...
    
    Tag     RtnLine       Time  TotalTime
    1             6   0.000154   0.000154            JRNDUMP
    2             0   0          0                   INT
    3             0   0          0                   getkey1
    4             0   0          0                   progress
    5             6   0.000050   0.000050            listhdr
    6            21   0.000240   0.000322            showlist
    7            20   0.136909   0.330301            listjrn
    8             7   0.188435   0.188435            getjrninfo
    9             0   0          0                   guijrn
    .
    .
    .
    
    

    这是一个选定例程的报告的一部分。

    逐行监视器编程接口

    程序员还可以通过 %Monitor.System.LineByLine 类与 MONITOR 工具进行交互。 ^%SYS.MONLBL 中为每个菜单选项提供了方法。例如,通过调用开始监控:

    Set status=##class(%Monitor.System.LineByLine).Start(Routine,Metric,Process)
    
    

    可以选择要监视的例程和进程您还可以选择 %Monitor.System 类支持的任何其他标准性能指标。使用 Monitor.System.LineByLine.GetMetrics() 方法检索指标名称列表:

    Set metrics=##class(%Monitor.System.LineByLine).GetMetrics(3)
    
    

    选择 3 作为参数会打印所有可用指标的列表,并对当前设备的每个指标进行简短描述。

    Do ##class(%Monitor.System.LineByLine).Stop()
    
    

    您可以使用 %Monitor.System.LineByLine:Result 查询检索收集的计数,其中每行的计数器以 $LIST 格式返回。

    相关文章

      网友评论

          本文标题:第四十二章 使用^%SYS.MONLBL检查例程性能 - 逐行分

          本文链接:https://www.haomeiwen.com/subject/pvgicdtx.html