Skip to content

Commit 2240032

Browse files
committed
fix: System Call proc linter
1 parent 0aa4b60 commit 2240032

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

coverage-integration.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mode: set
1+
mode: atomic

coverage-unit.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mode: set
1+
mode: atomic

internal/collector/system/host.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ func (c *HostCollector) GetSystemInfo() (*collector.SystemInfo, error) {
682682
lines := strings.Split(string(data), "\n")
683683
for i, line := range lines {
684684
// Find the Tcp: header line
685-
if strings.HasPrefix(line, "Tcp:") && !strings.Contains(line, " ") == false {
685+
if strings.HasPrefix(line, "Tcp:") && strings.Contains(line, " ") {
686686
// Check if this is the header line (contains column names)
687687
if strings.Contains(line, "RtoAlgorithm") {
688688
// Next line contains values
@@ -831,12 +831,10 @@ func (c *HostCollector) GetSystemInfo() (*collector.SystemInfo, error) {
831831

832832
// System calls - aggregate from all processes' /proc/[pid]/io
833833
// This counts read (syscr) and write (syscw) system calls
834-
if procs != nil {
835-
for _, p := range procs {
836-
ioCounters, err := p.IOCounters()
837-
if err == nil {
838-
info.SystemCalls += ioCounters.ReadCount + ioCounters.WriteCount
839-
}
834+
for _, p := range procs {
835+
ioCounters, err := p.IOCounters()
836+
if err == nil {
837+
info.SystemCalls += ioCounters.ReadCount + ioCounters.WriteCount
840838
}
841839
}
842840
}

0 commit comments

Comments
 (0)