2018-10-05 21:43:01 +00:00
|
|
|
package inputs
|
|
|
|
|
2018-10-16 00:38:36 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2018-10-05 21:43:01 +00:00
|
|
|
// CPUStats is based on telegraf CPUStats.
|
2018-10-16 00:38:36 +00:00
|
|
|
type CPUStats struct {
|
|
|
|
baseInput
|
|
|
|
}
|
|
|
|
|
|
|
|
// PluginName is based on telegraf plugin name.
|
|
|
|
func (c *CPUStats) PluginName() string {
|
|
|
|
return "cpu"
|
|
|
|
}
|
2018-10-05 21:43:01 +00:00
|
|
|
|
|
|
|
// TOML encodes to toml string
|
|
|
|
func (c *CPUStats) TOML() string {
|
2018-10-16 00:38:36 +00:00
|
|
|
return fmt.Sprintf(`[[inputs.%s]]
|
|
|
|
`, c.PluginName())
|
2018-10-05 21:43:01 +00:00
|
|
|
}
|