Skip to content

Commit

Permalink
dongjiang, fix zfs memory_available_bytes collector
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjiang1989 committed May 13, 2023
1 parent 184a4e0 commit 41f84bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions collector/zfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
// kstatDataChar = "0"
// kstatDataInt32 = "1"
// kstatDataUint32 = "2"
// kstatDataInt64 = "3"
kstatDataInt64 = "3"
kstatDataUint64 = "4"
// kstatDataLong = "5"
// kstatDataUlong = "6"
Expand Down Expand Up @@ -163,7 +163,7 @@ func (c *zfsCollector) parseProcfsFile(reader io.Reader, fmtExt string, handler

// kstat data type (column 2) should be KSTAT_DATA_UINT64, otherwise ignore
// TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured
if parts[1] == kstatDataUint64 {
if parts[1] == kstatDataUint64 || parts[1] == kstatDataInt64 {
key := fmt.Sprintf("kstat.zfs.misc.%s.%s", fmtExt, parts[0])
value, err := strconv.ParseUint(parts[2], 10, 64)
if err != nil {
Expand Down

0 comments on commit 41f84bd

Please sign in to comment.