From 53ea839771743bd5ade50d23dc4bd1431987fea2 Mon Sep 17 00:00:00 2001 From: Ulric Qin Date: Sun, 17 Apr 2022 08:02:33 +0800 Subject: [PATCH] rename InputName to inputName --- inputs/cpu/cpu.go | 6 +++--- inputs/disk/disk.go | 6 +++--- inputs/diskio/diskio.go | 6 +++--- inputs/kernel/kernel.go | 6 +++--- inputs/kernel/kernel_notlinux.go | 6 +++--- inputs/mem/mem.go | 6 +++--- inputs/net/net.go | 6 +++--- inputs/netstat/netstat.go | 6 +++--- inputs/system/system.go | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/inputs/cpu/cpu.go b/inputs/cpu/cpu.go index 4737b3a..c7932fe 100644 --- a/inputs/cpu/cpu.go +++ b/inputs/cpu/cpu.go @@ -10,7 +10,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "cpu" +const inputName = "cpu" type CPUStats struct { ps system.PS @@ -23,7 +23,7 @@ type CPUStats struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &CPUStats{ ps: ps, } @@ -31,7 +31,7 @@ func init() { } func (s *CPUStats) GetInputName() string { - return InputName + return inputName } func (s *CPUStats) GetIntervalSeconds() int64 { diff --git a/inputs/disk/disk.go b/inputs/disk/disk.go index 699ba0e..413df29 100644 --- a/inputs/disk/disk.go +++ b/inputs/disk/disk.go @@ -9,7 +9,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "disk" +const inputName = "disk" type DiskStats struct { ps system.PS @@ -22,7 +22,7 @@ type DiskStats struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &DiskStats{ ps: ps, } @@ -30,7 +30,7 @@ func init() { } func (s *DiskStats) GetInputName() string { - return InputName + return inputName } func (s *DiskStats) GetIntervalSeconds() int64 { diff --git a/inputs/diskio/diskio.go b/inputs/diskio/diskio.go index 33b1e51..8e707e3 100644 --- a/inputs/diskio/diskio.go +++ b/inputs/diskio/diskio.go @@ -10,7 +10,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "diskio" +const inputName = "diskio" type DiskIO struct { ps system.PS @@ -23,7 +23,7 @@ type DiskIO struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &DiskIO{ ps: ps, } @@ -31,7 +31,7 @@ func init() { } func (d *DiskIO) GetInputName() string { - return InputName + return inputName } func (d *DiskIO) GetIntervalSeconds() int64 { diff --git a/inputs/kernel/kernel.go b/inputs/kernel/kernel.go index acdd017..d1e3572 100644 --- a/inputs/kernel/kernel.go +++ b/inputs/kernel/kernel.go @@ -15,7 +15,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "kernel" +const inputName = "kernel" // /proc/stat file line prefixes to gather stats on: var ( @@ -35,7 +35,7 @@ type KernelStats struct { } func init() { - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &KernelStats{ statFile: "/proc/stat", entropyStatFile: "/proc/sys/kernel/random/entropy_avail", @@ -44,7 +44,7 @@ func init() { } func (s *KernelStats) GetInputName() string { - return InputName + return inputName } func (s *KernelStats) GetIntervalSeconds() int64 { diff --git a/inputs/kernel/kernel_notlinux.go b/inputs/kernel/kernel_notlinux.go index 86ba584..1d55fc6 100644 --- a/inputs/kernel/kernel_notlinux.go +++ b/inputs/kernel/kernel_notlinux.go @@ -8,7 +8,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "kernel" +const inputName = "kernel" type KernelStats struct { PrintConfigs bool `toml:"print_configs"` @@ -16,13 +16,13 @@ type KernelStats struct { } func init() { - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &KernelStats{} }) } func (s *KernelStats) GetInputName() string { - return InputName + return inputName } func (s *KernelStats) GetIntervalSeconds() int64 { diff --git a/inputs/mem/mem.go b/inputs/mem/mem.go index 8edf967..9ffbce4 100644 --- a/inputs/mem/mem.go +++ b/inputs/mem/mem.go @@ -9,7 +9,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "mem" +const inputName = "mem" type MemStats struct { ps system.PS @@ -22,7 +22,7 @@ type MemStats struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &MemStats{ ps: ps, } @@ -30,7 +30,7 @@ func init() { } func (s *MemStats) GetInputName() string { - return InputName + return inputName } func (s *MemStats) GetIntervalSeconds() int64 { diff --git a/inputs/net/net.go b/inputs/net/net.go index 77dc04c..2f6dbe2 100644 --- a/inputs/net/net.go +++ b/inputs/net/net.go @@ -11,7 +11,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "net" +const inputName = "net" type NetIOStats struct { ps system.PS @@ -26,7 +26,7 @@ type NetIOStats struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &NetIOStats{ ps: ps, } @@ -34,7 +34,7 @@ func init() { } func (s *NetIOStats) GetInputName() string { - return InputName + return inputName } func (s *NetIOStats) GetIntervalSeconds() int64 { diff --git a/inputs/netstat/netstat.go b/inputs/netstat/netstat.go index 7372531..87fe9fe 100644 --- a/inputs/netstat/netstat.go +++ b/inputs/netstat/netstat.go @@ -9,7 +9,7 @@ import ( "flashcat.cloud/categraf/types" ) -const InputName = "netstat" +const inputName = "netstat" type NetStats struct { ps system.PS @@ -20,7 +20,7 @@ type NetStats struct { func init() { ps := system.NewSystemPS() - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &NetStats{ ps: ps, } @@ -28,7 +28,7 @@ func init() { } func (s *NetStats) GetInputName() string { - return InputName + return inputName } func (s *NetStats) GetIntervalSeconds() int64 { diff --git a/inputs/system/system.go b/inputs/system/system.go index c42c034..b60ffb1 100644 --- a/inputs/system/system.go +++ b/inputs/system/system.go @@ -12,7 +12,7 @@ import ( "github.com/shirou/gopsutil/v3/load" ) -const InputName = "system" +const inputName = "system" type SystemStats struct { PrintConfigs bool `toml:"print_configs"` @@ -21,13 +21,13 @@ type SystemStats struct { } func init() { - inputs.Add(InputName, func() inputs.Input { + inputs.Add(inputName, func() inputs.Input { return &SystemStats{} }) } func (s *SystemStats) GetInputName() string { - return InputName + return inputName } func (s *SystemStats) GetIntervalSeconds() int64 {