2016-02-03 03:25:01 +00:00
|
|
|
package exec
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/influxdata/telegraf/internal/encoding/graphite"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Config represents the configuration for Graphite endpoints.
|
|
|
|
type Config struct {
|
|
|
|
Commands []string
|
2016-02-03 15:47:55 +00:00
|
|
|
graphite.Config
|
2016-02-03 03:25:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// New Config instance.
|
2016-02-04 06:02:47 +00:00
|
|
|
func NewConfig(commands, templates []string, separator string) *Config {
|
2016-02-03 03:25:01 +00:00
|
|
|
c := &Config{}
|
2016-02-04 06:02:47 +00:00
|
|
|
if separator == "" {
|
|
|
|
separator = graphite.DefaultSeparator
|
|
|
|
}
|
|
|
|
|
2016-02-03 03:25:01 +00:00
|
|
|
c.Commands = commands
|
|
|
|
c.Templates = templates
|
|
|
|
c.Separator = separator
|
|
|
|
|
2016-02-04 06:02:47 +00:00
|
|
|
return c
|
2016-02-03 03:25:01 +00:00
|
|
|
}
|