enable linter on repository

This commit is contained in:
Sergey Kanzhelev
2025-08-08 17:29:46 +00:00
parent dea6d70d46
commit a4118329f6
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)