diff options
author | Julius Volz <julius@soundcloud.com> | 2015-09-10 12:21:25 +0200 |
---|---|---|
committer | Julius Volz <julius@soundcloud.com> | 2015-09-10 12:21:25 +0200 |
commit | 6f17231e44466cf2059e0705628c9e5a95bbb8fd (patch) | |
tree | 7d6b89eb5559a9b649451eef40c5269604fb4211 /collector/sockstat_linux.go | |
parent | dd5fc6a3ca73e73b2bf71348fd223c975c5ac963 (diff) | |
download | prometheus_node_collector-6f17231e44466cf2059e0705628c9e5a95bbb8fd.tar.bz2 prometheus_node_collector-6f17231e44466cf2059e0705628c9e5a95bbb8fd.tar.xz prometheus_node_collector-6f17231e44466cf2059e0705628c9e5a95bbb8fd.zip |
Minor comment cleanups.
Diffstat (limited to 'collector/sockstat_linux.go')
-rw-r--r-- | collector/sockstat_linux.go | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/collector/sockstat_linux.go b/collector/sockstat_linux.go index 0d471f8..d9f1944 100644 --- a/collector/sockstat_linux.go +++ b/collector/sockstat_linux.go | |||
@@ -84,7 +84,7 @@ func parseSockStats(r io.Reader, fileName string) (map[string]map[string]string, | |||
84 | 84 | ||
85 | for scanner.Scan() { | 85 | for scanner.Scan() { |
86 | line := strings.Split(string(scanner.Text()), " ") | 86 | line := strings.Split(string(scanner.Text()), " ") |
87 | // Remove trailing :. | 87 | // Remove trailing ':'. |
88 | protocol := line[0][:len(line[0])-1] | 88 | protocol := line[0][:len(line[0])-1] |
89 | sockStat[protocol] = map[string]string{} | 89 | sockStat[protocol] = map[string]string{} |
90 | 90 | ||
@@ -94,13 +94,10 @@ func parseSockStats(r io.Reader, fileName string) (map[string]map[string]string, | |||
94 | } | 94 | } |
95 | } | 95 | } |
96 | 96 | ||
97 | /* | 97 | // The mem metrics is the count of pages used. Multiply the mem metrics by |
98 | The mem metrics is the count of pages used. | 98 | // the page size from the kernel to get the number of bytes used. |
99 | Multiply the mem metrics by the page size from the kernal to get the number | 99 | // |
100 | of bytes used. | 100 | // Update the TCP mem from page count to bytes. |
101 | |||
102 | Update the TCP mem from page count to bytes. | ||
103 | */ | ||
104 | pageCount, err := strconv.Atoi(sockStat["TCP"]["mem"]) | 101 | pageCount, err := strconv.Atoi(sockStat["TCP"]["mem"]) |
105 | if err != nil { | 102 | if err != nil { |
106 | return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["TCP"]["mem"], err) | 103 | return nil, fmt.Errorf("invalid value %s in sockstats: %s", sockStat["TCP"]["mem"], err) |