Merge pull request #1088 from SergeyKanzhelev/linter

enable linter on repository
This commit is contained in:
Kubernetes Prow Robot
2025-08-13 09:41:07 -07:00
committed by GitHub
8 changed files with 67 additions and 2 deletions

View File

@@ -14,8 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package types contains the types for log counter.
package types
// LogCounter is the interface for a log counter.
type LogCounter interface {
Count() (int, error)
}

View File

@@ -62,6 +62,10 @@ func (cc *cpuCollector) recordSystemStats() {
}
fs, err := procfs.NewFS(cc.procPath)
if err != nil {
klog.Errorf("Failed to open procfs: %v", err)
return
}
stats, err := fs.Stat()
if err != nil {
klog.Errorf("Failed to retrieve cpu/process stats: %v", err)

View File

@@ -219,6 +219,10 @@ func (nc *netCollector) mustRegisterMetric(metricID metrics.MetricID, descriptio
func (nc *netCollector) recordNetDev() {
fs, err := procfs.NewFS(nc.procPath)
if err != nil {
klog.Errorf("Failed to open procfs: %v", err)
return
}
stats, err := fs.NetDev()
if err != nil {
klog.Errorf("Failed to retrieve net dev stat: %v", err)