mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-02-14 18:09:57 +00:00
enable linter on repository
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user