性能计数器
ONTAP 计数器管理器可维护有关每个ONTAP 系统性能的大量信息。它会将此数据导出为一组_performance计数器_、您可以使用这些计数器评估ONTAP 系统的性能并帮助实现性能目标。
访问ONTAP 性能计数器
您可以使用两个不同的API以及通过ONTAP 命令行界面访问ONTAP 性能计数器。
在自动化管理ONTAP 部署时、ONTAP REST API是首选的战略性选项。 |
ONTAPI
NetApp网络易管理性SDK提供ONTAPI。使用ONTAPI时、性能计数器在一组对象中定义。每个对象对应于系统的一个物理或虚拟组件。根据系统配置、每个对象可以有一个或多个实例。
例如、如果您的ONTAP 系统有四个物理磁盘、则会有四个实例 disk
对象、每个对象都有自己的一组性能计数器。您可以使用ONTAPI访问每个磁盘实例的各个计数器。
ONTAP REST API
从ONTAP 9.11.1开始、您还可以通过REST API访问性能数据。在这种情况下、性能计数器按表进行组织、这些表相当于ONTAPI对象。每个表行都相当于ONTAPI对象的一个实例。
例如、如果您的ONTAP 系统有四个物理磁盘、则为 disk
表将包含四行。每一行都可以单独访问、并包含自己的一组性能计数器、这些计数器可作为行中的字段或列使用。
准备使用 REST API
在使用ONTAP REST API访问性能计数器之前、您应做好准备。
性能计数器以表形式组织
一组ONTAPI对象可通过ONTAP REST API访问、并显示为表。例如、ONTAPI * hostadapter*对象通过REST API显示为* host_adpater*表。系统中的每个主机适配器都是一行、其中包含自己的一组性能计数器。
Instance name | 性能计数器 | |||||
---|---|---|---|---|---|---|
host_adapter_1 |
Total_Read_OPS_1 |
total_write_ops_1 |
bytes_read_1 |
bytes_writed_1 |
max_link_data_rate_1 |
RSCN_count_1 |
host_adapter_2 |
Total_Read_ops_2 |
Total_write_ops_2 |
bytes_read_2 |
bytes_writed_2 |
max_link_data_rate_2 |
RSCN_count_2 |
host_adapter_3. |
总读取操作数_3 |
total_write_ops_3. |
bytes_read_3 |
bytes_writed_3. |
max_link_data_rate_3. |
RSCN_count_3 |
REST端点摘要
有四个主要端点可用于访问ONTAP 性能计数器和相关表。
每个REST端点都提供只读访问、并且仅支持*获取* HTTP方法。请参见 "API 参考" 有关详细信息 … |
-
集群/计数器/表
返回计数器表及其架构定义的集合。
-
/集群/计数器/表/{name}
返回有关单个命名计数器表的信息。
-
/集群/计数器/表/{counter_name}/rows
返回命名计数器表中的行集合。
-
/集群/计数器/表/{counter_name}/行/{id}
返回命名计数器表中的特定行。
从ONTAPI迁移到REST API
NetApp广泛支持将自动化代码从ONTAPI迁移到ONTAP REST API。这包括将文档映射到身份标识在REST API中为给定ONTAPI对象提供的等效性能计数器表。
请根据您使用的ONTAP 版本查看相应的映射文档:
开始使用ONTAP REST API
以下示例说明了如何使用REST API访问ONTAP 性能计数器。其中包括检索可用表的列表以及浏览表结构。
开始之前
在使用示例之前、请查看以下信息。
您需要一个包含密码的ONTAP 管理员帐户。
您需要为ONTAP 系统配置集群管理IP地址。
以下所有示例只能用于使用HTTP GET方法检索信息。
每个卷曲示例都包含一个或多个变量、以大写字母和带括号的文本表示。请务必根据您的环境情况将这些变量替换为实际值。
以下示例顺序说明了如何使用可用于检索性能计数器的REST端点。请参见 REST端点摘要 有关详细信息 …
示例1:所有性能计数器表
您可以使用此REST API调用来发现所有可用的计数器管理器表。
curl 示例
curl --request GET --user admin:<PASSWORD> 'https://<ONTAP_IP_ADDRESS>/api/cluster/counter/tables'
JSON 输出示例
{
"records": [
{
"name": "copy_manager",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/copy_manager"
}
}
},
{
"name": "copy_manager:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/copy_manager%3Aconstituent"
}
}
},
{
"name": "disk",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/disk"
}
}
},
{
"name": "disk:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/disk%3Aconstituent"
}
}
},
{
"name": "disk:raid_group",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/disk%3Araid_group"
}
}
},
{
"name": "external_cache",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/external_cache"
}
}
},
{
"name": "fcp",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp"
}
}
},
{
"name": "fcp:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp%3Anode"
}
}
},
{
"name": "fcp_lif",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp_lif"
}
}
},
{
"name": "fcp_lif:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp_lif%3Anode"
}
}
},
{
"name": "fcp_lif:port",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp_lif%3Aport"
}
}
},
{
"name": "fcp_lif:svm",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcp_lif%3Asvm"
}
}
},
{
"name": "fcvi",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/fcvi"
}
}
},
{
"name": "headroom_aggregate",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/headroom_aggregate"
}
}
},
{
"name": "headroom_cpu",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/headroom_cpu"
}
}
},
{
"name": "host_adapter",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter"
}
}
},
{
"name": "iscsi_lif",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/iscsi_lif"
}
}
},
{
"name": "iscsi_lif:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/iscsi_lif%3Anode"
}
}
},
{
"name": "iscsi_lif:svm",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/iscsi_lif%3Asvm"
}
}
},
{
"name": "lif",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/lif"
}
}
},
{
"name": "lif:svm",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/lif%3Asvm"
}
}
},
{
"name": "lun",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/lun"
}
}
},
{
"name": "lun:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/lun%3Aconstituent"
}
}
},
{
"name": "lun:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/lun%3Anode"
}
}
},
{
"name": "namespace",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/namespace"
}
}
},
{
"name": "namespace:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/namespace%3Aconstituent"
}
}
},
{
"name": "nfs_v4_diag",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nfs_v4_diag"
}
}
},
{
"name": "nic_common",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nic_common"
}
}
},
{
"name": "nvmf_lif",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nvmf_lif"
}
}
},
{
"name": "nvmf_lif:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nvmf_lif%3Aconstituent"
}
}
},
{
"name": "nvmf_lif:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nvmf_lif%3Anode"
}
}
},
{
"name": "nvmf_lif:port",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/nvmf_lif%3Aport"
}
}
},
{
"name": "object_store_client_op",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/object_store_client_op"
}
}
},
{
"name": "path",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/path"
}
}
},
{
"name": "processor",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/processor"
}
}
},
{
"name": "processor:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/processor%3Anode"
}
}
},
{
"name": "qos",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos"
}
}
},
{
"name": "qos:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos%3Aconstituent"
}
}
},
{
"name": "qos:policy_group",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos%3Apolicy_group"
}
}
},
{
"name": "qos_detail",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos_detail"
}
}
},
{
"name": "qos_detail_volume",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos_detail_volume"
}
}
},
{
"name": "qos_volume",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos_volume"
}
}
},
{
"name": "qos_volume:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qos_volume%3Aconstituent"
}
}
},
{
"name": "qtree",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qtree"
}
}
},
{
"name": "qtree:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/qtree%3Aconstituent"
}
}
},
{
"name": "svm_cifs",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_cifs"
}
}
},
{
"name": "svm_cifs:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_cifs%3Aconstituent"
}
}
},
{
"name": "svm_cifs:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_cifs%3Anode"
}
}
},
{
"name": "svm_nfs_v3",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v3"
}
}
},
{
"name": "svm_nfs_v3:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v3%3Aconstituent"
}
}
},
{
"name": "svm_nfs_v3:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v3%3Anode"
}
}
},
{
"name": "svm_nfs_v4",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v4"
}
}
},
{
"name": "svm_nfs_v41",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v41"
}
}
},
{
"name": "svm_nfs_v41:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v41%3Aconstituent"
}
}
},
{
"name": "svm_nfs_v41:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v41%3Anode"
}
}
},
{
"name": "svm_nfs_v42",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v42"
}
}
},
{
"name": "svm_nfs_v42:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v42%3Aconstituent"
}
}
},
{
"name": "svm_nfs_v42:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v42%3Anode"
}
}
},
{
"name": "svm_nfs_v4:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v4%3Aconstituent"
}
}
},
{
"name": "svm_nfs_v4:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/svm_nfs_v4%3Anode"
}
}
},
{
"name": "system",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/system"
}
}
},
{
"name": "system:constituent",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/system%3Aconstituent"
}
}
},
{
"name": "system:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/system%3Anode"
}
}
},
{
"name": "token_manager",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/token_manager"
}
}
},
{
"name": "volume",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/volume"
}
}
},
{
"name": "volume:node",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/volume%3Anode"
}
}
},
{
"name": "volume:svm",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/volume%3Asvm"
}
}
},
{
"name": "wafl",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/wafl"
}
}
},
{
"name": "wafl_comp_aggr_vol_bin",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/wafl_comp_aggr_vol_bin"
}
}
},
{
"name": "wafl_hya_per_aggregate",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/wafl_hya_per_aggregate"
}
}
},
{
"name": "wafl_hya_sizer",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/wafl_hya_sizer"
}
}
}
],
"num_records": 71,
"_links": {
"self": {
"href": "/api/cluster/counter/tables"
}
}
}
示例2:有关特定表的高级信息
您可以使用此REST API调用来显示特定表的问题描述 和元数据。输出内容包括表的用途以及每个性能计数器包含的数据类型。本示例使用了*主机适配器*表。
curl 示例
curl --request GET --user admin:<PASSWORD> 'https://<ONTAP_IP_ADDRESS>/api/cluster/counter/tables/host_adapter'
JSON 输出示例
{
"name": "host_adapter",
"description": "The host_adapter table reports activity on the Fibre Channel, Serial Attached SCSI, and parallel SCSI host adapters the storage system uses to connect to disks and tape drives.",
"counter_schemas": [
{
"name": "bytes_read",
"description": "Bytes read through a host adapter",
"type": "rate",
"unit": "per_sec"
},
{
"name": "bytes_written",
"description": "Bytes written through a host adapter",
"type": "rate",
"unit": "per_sec"
},
{
"name": "max_link_data_rate",
"description": "Max link data rate in Kilobytes per second for a host adapter",
"type": "raw",
"unit": "kb_per_sec"
},
{
"name": "node.name",
"description": "System node name",
"type": "string",
"unit": "none"
},
{
"name": "rscn_count",
"description": "Number of RSCN(s) received by the FC HBA",
"type": "raw",
"unit": "none"
},
{
"name": "total_read_ops",
"description": "Total number of reads on a host adapter",
"type": "rate",
"unit": "per_sec"
},
{
"name": "total_write_ops",
"description": "Total number of writes on a host adapter",
"type": "rate",
"unit": "per_sec"
}
],
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter"
}
}
}
示例3:特定表中的所有行
您可以使用此REST API调用查看表中的所有行。这表示存在哪些计数器管理器对象实例。
curl 示例
curl --request GET --user admin:<PASSWORD> 'https://<ONTAP_IP_ADDRESS>/api/cluster/counter/tables/host_adapter/rows'
JSON 输出示例
{
"records": [
{
"id": "dmp-adapter-01",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter/rows/dmp-adapter-01"
}
}
},
{
"id": "dmp-adapter-02",
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter/rows/dmp-adapter-02"
}
}
}
],
"num_records": 2,
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter/rows"
}
}
}
示例4:特定表中的单行
您可以使用此REST API调用查看表中特定计数器管理器实例的性能计数器值。在此示例中、请求其中一个主机适配器的性能数据。
curl 示例
curl --request GET --user admin:<PASSWORD> 'https://<ONTAP_IP_ADDRESS>/api/cluster/counter/tables/host_adapter/rows/dmp-adapter-01'
JSON 输出示例
{
"counter_table": {
"name": "host_adapter"
},
"id": "dmp-adapter-01",
"properties": [
{
"name": "node.name",
"value": "dmp-node-01"
}
],
"counters": [
{
"name": "total_read_ops",
"value": 25098
},
{
"name": "total_write_ops",
"value": 48925
},
{
"name": "bytes_read",
"value": 1003799680
},
{
"name": "bytes_written",
"value": 6900961600
},
{
"name": "max_link_data_rate",
"value": 0
},
{
"name": "rscn_count",
"value": 0
}
],
"_links": {
"self": {
"href": "/api/cluster/counter/tables/host_adapter/rows/dmp-adapter-01"
}
}
}