mh_metric
Analyze media heuristic metrics
TLDR
Print the code metrics for the specified files
Print the code metrics for the specified Octave files
Print the code metrics for the specified directory recursively
Print the code metrics for the current directory
Print the code metrics report in HTML or JSON format
SYNOPSIS
mh_metric [OPTIONS]
PARAMETERS
-q, --query
Queries and displays the current values of performance metrics.
-d, --dump
Dumps all available counters supported by the HCA.
-r, --reset
Resets all specified (or all if not specified) performance counters on the HCA to zero.
-D <device>, --ib_dev <device>
Specifies the InfiniBand device (e.g., mlx5_0) to query. If not specified, the first available device is used.
-P <port>, --ib_port <port>
Specifies the InfiniBand port number (e.g., 1) on the device. If not specified, the first available port is used.
-c <name>, --counter <name>
Queries a specific counter by its name (e.g., 'PortXmitData'). Can be used multiple times for several counters.
-a, --all
Applies the operation (query, dump, reset) to all available InfiniBand devices and ports found on the system.
-S, --show-type
When dumping or querying, shows the type of each counter (e.g., IB, PCI, MLX-specific).
-h, --help
Displays a help message and exits.
DESCRIPTION
mh_metric is a specialized command-line utility provided as part of the Mellanox OFED (OpenFabrics Enterprise Distribution) software suite, now part of NVIDIA Networking. Its primary function is to query, display, and manage performance counters and metrics directly from Mellanox InfiniBand Host Channel Adapters (HCAs).
It allows administrators and users to gain deep insights into the health and performance of InfiniBand links, tracking crucial statistics such as sent/received packets, bytes, various error types (e.g., local link integrity errors, symbol errors), and specific Virtual Lane (VL) counters. This tool is invaluable for detailed performance analysis, identifying and troubleshooting network bottlenecks, and ensuring the optimal and reliable operation of InfiniBand-based high-performance computing (HPC) clusters, AI infrastructures, and data centers.
CAVEATS
- Requires Mellanox InfiniBand Host Channel Adapters (HCAs) and the Mellanox OFED (OpenFabrics Enterprise Distribution) software stack to be installed.
- Often requires root privileges to access and modify HCA performance counters directly.
- The collected metrics are specific to Mellanox hardware and may not be directly comparable or available on InfiniBand hardware from other vendors.
- Output can be verbose, making direct parsing challenging without scripting.
METRIC TYPES
mh_metric is capable of querying various categories of counters, including standard InfiniBand (IB) port counters, PCI-related counters, and a rich set of Mellanox-specific (MLX) counters that offer unique insights into the HCA's internal operations and link characteristics.
USAGE CONTEXT
This command is primarily utilized by network administrators, HPC engineers, and system integrators for tasks such as performance tuning, debugging complex network issues, validating link integrity, and capacity planning in environments heavily reliant on InfiniBand interconnects for high-throughput and low-latency communication.
HISTORY
InfiniBand technology gained prominence in the early 2000s as a high-performance interconnect for HPC and data centers. Mellanox Technologies (later acquired by NVIDIA) emerged as a dominant vendor in this space. mh_metric was developed as part of the Mellanox OFED software stack to provide detailed, vendor-specific insights into HCA performance counters. Its development and usage grew in parallel with the widespread adoption of Mellanox InfiniBand adapters, becoming a crucial tool for administrators seeking granular visibility and control over their InfiniBand network fabric, complementing more generic InfiniBand monitoring tools.
SEE ALSO
perfquery(8), ibstat(8), ib_write_bw(1), ib_send_bw(1), ofed_info(8)