github.com/influxdata/influxdb/v2@v2.7.6/telegraf/plugins/inputs/cpu.go (about)

     1  package inputs
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  // CPUStats is based on telegraf CPUStats.
     8  type CPUStats struct {
     9  	baseInput
    10  }
    11  
    12  // PluginName is based on telegraf plugin name.
    13  func (c *CPUStats) PluginName() string {
    14  	return "cpu"
    15  }
    16  
    17  // UnmarshalTOML decodes the parsed data to the object
    18  func (c *CPUStats) UnmarshalTOML(data interface{}) error {
    19  	return nil
    20  }
    21  
    22  // TOML encodes to toml string
    23  func (c *CPUStats) TOML() string {
    24  	return fmt.Sprintf(`[[inputs.%s]]
    25    ## Whether to report per-cpu stats or not
    26    percpu = true
    27    ## Whether to report total system cpu stats or not
    28    totalcpu = true
    29    ## If true, collect raw CPU time metrics
    30    collect_cpu_time = false
    31    ## If true, compute and report the sum of all non-idle CPU states
    32    report_active = false
    33  `, c.PluginName())
    34  }