New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiply port data XMIT/RCV metrics by 4 #579

Merged
merged 1 commit into from May 12, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+15 −6
Diff settings

Always

Just for now

@@ -703,12 +703,12 @@ node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp4"} 84
node_hwmon_temp_max_celsius{chip="platform_coretemp_1",sensor="temp5"} 84
# HELP node_infiniband_legacy_data_received_bytes_total Number of data octets received on all links
# TYPE node_infiniband_legacy_data_received_bytes_total counter
node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="1"} 4.631917e+06
node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="2"} 4.631917e+06
node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="1"} 1.8527668e+07
node_infiniband_legacy_data_received_bytes_total{device="mlx4_0",port="2"} 1.8527668e+07
# HELP node_infiniband_legacy_data_transmitted_bytes_total Number of data octets transmitted on all links
# TYPE node_infiniband_legacy_data_transmitted_bytes_total counter
node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="1"} 3.73344e+06
node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="2"} 3.73344e+06
node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="1"} 1.493376e+07
node_infiniband_legacy_data_transmitted_bytes_total{device="mlx4_0",port="2"} 1.493376e+07
# HELP node_infiniband_legacy_multicast_packets_received_total Number of multicast packets received
# TYPE node_infiniband_legacy_multicast_packets_received_total counter
node_infiniband_legacy_multicast_packets_received_total{device="mlx4_0",port="1"} 93
@@ -751,11 +751,11 @@ node_infiniband_multicast_packets_transmitted_total{device="mlx4_0",port="1"} 16
node_infiniband_multicast_packets_transmitted_total{device="mlx4_0",port="2"} 0
# HELP node_infiniband_port_data_received_bytes Number of data octets received on all links
# TYPE node_infiniband_port_data_received_bytes counter
node_infiniband_port_data_received_bytes{device="mlx4_0",port="1"} 4.631917e+06
node_infiniband_port_data_received_bytes{device="mlx4_0",port="1"} 1.8527668e+07
node_infiniband_port_data_received_bytes{device="mlx4_0",port="2"} 0
# HELP node_infiniband_port_data_transmitted_bytes Number of data octets transmitted on all links
# TYPE node_infiniband_port_data_transmitted_bytes counter
node_infiniband_port_data_transmitted_bytes{device="mlx4_0",port="1"} 3.73344e+06
node_infiniband_port_data_transmitted_bytes{device="mlx4_0",port="1"} 1.493376e+07
node_infiniband_port_data_transmitted_bytes{device="mlx4_0",port="2"} 0
# HELP node_infiniband_unicast_packets_received_total Number of unicast packets received (including errors)
# TYPE node_infiniband_unicast_packets_received_total counter
Copy path View file
@@ -148,6 +148,15 @@ func readMetric(directory, metricFile string) (uint64, error) {
return 0, err
}

// According to Mellanox, the following metrics "are divided by 4 unconditionally"
// as they represent the amount of data being transmitted and received per lane.
// Mellanox cards have 4 lanes per port, so all values must be multiplied by 4
// to get the expected value.
switch metricFile {
case "port_rcv_data", "port_xmit_data", "port_rcv_data_64", "port_xmit_data_64":
metric *= 4
}

return metric, nil
}

ProTip! Use n and p to navigate between commits in a pull request.