Merge "BugFix: Missing VF info and Pod info"

This commit is contained in:
Zuul 2024-07-04 16:59:14 +00:00 committed by Gerrit Code Review
commit a162767e8a

View File

@ -196,7 +196,7 @@ func regDevInfo(
// Function to cast Pod Details data from struct to openmetrics format // Function to cast Pod Details data from struct to openmetrics format
func podStatsOpenMetfmt(podDet map[string]string) string { func podStatsOpenMetfmt(podDet map[string]string) string {
var reg = openmetrics.NewRegistry() var reg = openmetrics.NewRegistry()
regName := "network_interface_vf_kube_pod" regName := "network_interface_vf_kube_pod_info"
var openMetVar = regDevInfo( var openMetVar = regDevInfo(
reg, regName, regName, []string{ reg, regName, regName, []string{
"namespace", "pod", "container", "resource", "device", "vf", "namespace", "pod", "container", "resource", "device", "vf",
@ -213,7 +213,7 @@ func podStatsOpenMetfmt(podDet map[string]string) string {
podDet["Vf"], podDet["Vf"],
podDet["Pciaddr"], podDet["Pciaddr"],
podDet["HardwareAddr"], podDet["HardwareAddr"],
) ).Add(float64(1))
// create buffer to return // create buffer to return
var buf bytes.Buffer var buf bytes.Buffer
@ -227,7 +227,7 @@ func podStatsOpenMetfmt(podDet map[string]string) string {
// Function to cast VfDevice data from struct to openmetrics format // Function to cast VfDevice data from struct to openmetrics format
func vfDeviceOpenMetfmt(devInfo VfDevice) string { func vfDeviceOpenMetfmt(devInfo VfDevice) string {
var reg = openmetrics.NewRegistry() var reg = openmetrics.NewRegistry()
regName := "network_interface_vf_device" regName := "network_interface_vf_device_info"
var openMetVar = regDevInfo( var openMetVar = regDevInfo(
reg, reg,
regName, regName,
@ -243,7 +243,7 @@ func vfDeviceOpenMetfmt(devInfo VfDevice) string {
strconv.Itoa(devInfo.VfInfo.Vlan), strconv.Itoa(devInfo.VfInfo.Vlan),
BoolToOnOff(devInfo.VfInfo.Spoofchk), BoolToOnOff(devInfo.VfInfo.Spoofchk),
intToOnOff(devInfo.VfInfo.Trust), intToOnOff(devInfo.VfInfo.Trust),
) ).Add(float64(1))
statsString := vfStatsOpenMetfmt(devInfo) statsString := vfStatsOpenMetfmt(devInfo)
// create buffer to return // create buffer to return
var buf bytes.Buffer var buf bytes.Buffer