kube-proxy iptables expose number of rules metrics

add a new metric to kube-proxy iptables, so it exposes the number
of rules programmed in each iteration.
This commit is contained in:
Antonio Ojea
2021-03-02 18:35:32 +01:00
parent f79795d718
commit 654be57022
5 changed files with 203 additions and 0 deletions

View File

@@ -494,3 +494,8 @@ func RevertPorts(replacementPortsMap, originalPortsMap map[utilnet.LocalPort]uti
}
}
}
// CountBytesLines counts the number of lines in a bytes slice
func CountBytesLines(b []byte) int {
return bytes.Count(b, []byte{'\n'})
}