code refactor for nfsclient plugin

This commit is contained in:
Ulric Qin 2022-07-28 09:37:25 +08:00
parent 18a55f4e87
commit fa0c38da61
2 changed files with 5 additions and 16 deletions

View File

@ -1,15 +1,8 @@
# # collect interval
# interval = 15
# # append some labels for series
# labels = { region="cloud", product="n9e" }
# # interval = global.interval * interval_times
# interval_times = 1
## Read more low-level metrics (optional, defaults to false)
fullstat = false
fullstat = false
## List of mounts to explictly include or exclude (optional)
## The pattern (Go regexp) is matched against the mount point (not the
@ -17,8 +10,8 @@
## unless present in the list. If a mount is listed in both include_mounts
## and exclude_mounts, it is excluded. Go regexp patterns can be used.
# include_mounts = []
# exclude_mounts = []
# include_mounts = []
# exclude_mounts = []
## List of operations to include or exclude from collecting. This applies
## only when fullstat=true. Symantics are similar to {include,exclude}_mounts:
@ -33,5 +26,5 @@
## with their own lists. See "include_mounts" above, and be careful of
## duplicate metrics.
#include_operations = ['READ','WRITE','ACCESS','GETATTR','READDIR','LOOKUP']
# include_operations = ['READ','WRITE','ACCESS','GETATTR','READDIR','LOOKUP']
# exclude_operations = []

View File

@ -36,10 +36,6 @@ func init() {
})
}
func (s *NfsClient) Prefix() string {
return inputName
}
func (s *NfsClient) Init() error {
var nfs3Fields = []string{
"NULL",
@ -279,7 +275,7 @@ func (s *NfsClient) parseStat(mountpoint string, export string, version string,
}
if len(nline) == 0 {
log.Println("W! Parsing Stat line with one field: %s\n", line)
log.Println("W! Parsing Stat line with one field:", line)
return nil
}