第三十五章 使用 ^PERFMON 监控系统性能 - Clear
Clear
清除所有指标计数器。
status = $$Clear^PERFMON()
| Status code | Description |
|---|---|
| 1 | Successful |
| -1 | 其他人正在使用 Monitor
|
| -2 | 监视器未运行 |
Report
报告功能收集并输出指标报告。
status = $$Report^PERFMON(report,sort,format,output,[list],[data])
-
report— 要输出的报告类型;有效值为:-
G– 用于全球活动 -
R– 用于日常活动 -
N– 用于网络活动 -
C– 用于您选择要报告的指标的自定义报告
-
-
sort——报告的分组和排序顺序;有效值为:-
P– 按进程组织报告 -
R– 按例程组织报告 -
G– 按全局组织报告 -
D– 按数据库组织报告 -
I– 按传入节点组织报告 -
O– 组织按传出节点报告报告
-
-
format— 输出格式;有效值为:-
P– 用于可打印/可查看的报告(.txt文件,无分页) -
D– 用于逗号分隔数据(.csv文件),可以读入电子表格 -
X– 用于Microsoft Excel适合导入Excel的XML标记(.xml文件) -
H– 用于HTML页面 (.html文件)nodeo报告
-
output— 输入文件名,返回接受显示的默认文件名,或0(零)输出到screeno报告list—(仅适用于自定义报告)以逗号分隔的指标编号列表,指定要包含在报告中的列;输入 ?在为所有可能的指标及其数量的列表指定自定义报告之后。-
data— 要报告的数据类型;有效值为:-
1– 标准速率/秒 -
2– 原始总计
-
| Status code | Description |
|---|---|
| 1 | Successful |
| -1 | 监视器未运行 |
| -2 | 缺少输入参数 |
| -3 | 报告类别无效 |
| -4 | 报告组织无效 |
| -5 | 报告格式无效 |
| -6 | 自定义报告的列表无效 |
| -7 | 数据格式无效 |
报告示例部分展示了如何为输入参数输入不同的值。
Collect
定时收集和报告功能通过收集指定时间段(默认为 30 秒)的指标,创建五个基本报告和一个进程计数,并将它们一起格式化为 Excel 电子表格或 HTML 页面,从而提供系统性能的快速自动快照.
status = $$Collect^PERFMON(time,format,output)
-
time— 数据收集的秒数(默认30) -
format— 输出格式;有效值为:-
X– 适用于Microsoft Excel适合导入Excel的XML标记(.xml文件) -
H– 适用于HTML页面(.html文件)
-
-
output— 输入文件名,返回以接受显示的默认文件名,或0(零)用于输出到屏幕)
| Status code | Description |
|---|---|
| 1 | Successful |
| -1 | 监视器未运行 |
| -3 | 监视器已经在运行 |
Report Examples
以下是运行全局统计报告的示例,该报告按全局名称收集和排序,并输出到管理器目录中名为 perfmon.txt 的文件。
%SYS>Do ^PERFMON
1. Start Monitor
2. Stop Monitor
3. Pause Monitor
4. Resume Monitor
5. Sample Counters
6. Clear Counters
7. Report Statistics
8. Timed Collect & Report
Enter the number of your choice: 7
Category may be: G=Global, R=Routine, N=Network or C=Custom
Category ('G', 'R', 'N' or 'C'): g
Sort may be: P=Process, R=Routine, G=Global, D=Database, I=Incoming or O=Outgoing node
Sort ('P', 'R', 'G', 'D', 'I' or 'O'): g
Format may be: P=Print, D=Delimited data, X=Excel XML, H=HTML
Format ('P', 'D', 'X', 'H'): p
File name: perfmon.txt
Press RETURN to continue ...
以下是运行自定义统计报告的示例,该报告对应于具有以下数字的指标:5、10、15、20、25、30、35、40、45、50。计数按进程 ID 收集和排序,并输出到管理器目录中名为 perfmonC.txt 的文件中。
1. Start Monitor
2. Stop Monitor
3. Pause Monitor
4. Resume Monitor
5. Sample Counters
6. Clear Counters
7. Report Statistics
8. Timed Collect & Report
Enter the number of your choice: 7
Category may be: G=Global, R=Routine, N=Network or C=Custom
Category ('G', 'R', 'N' or 'C'): c
List of field numbers: 5,10,15,20,25,30,35,40,45,50
Sort may be: P=Process, R=Routine, G=Global, D=Database, I=Incoming or O=Outgoing node
Sort ('P', 'R', 'G', 'D', 'I' or 'O'): p
Format may be: P=Print, D=Delimited data, X=Excel XML, H=HTML
Format ('P', 'D', 'X', 'H'): p
File name: perfmonC.txt