Change (previously unused) single udp config to support multiple UDP listeners
do not use NewConfig for UDP appendUDPService must return a value udp service does not need to handle error fix missing case of c.UDP in testspull/3599/head
parent
596db019a0
commit
e943afacdc
|
@ -35,7 +35,7 @@ type Config struct {
|
|||
Graphites []graphite.Config `toml:"graphite"`
|
||||
Collectd collectd.Config `toml:"collectd"`
|
||||
OpenTSDB opentsdb.Config `toml:"opentsdb"`
|
||||
UDP udp.Config `toml:"udp"`
|
||||
UDPs []udp.Config `toml:"udp"`
|
||||
|
||||
// Snapshot SnapshotConfig `toml:"snapshot"`
|
||||
Monitoring monitor.Config `toml:"monitoring"`
|
||||
|
|
|
@ -38,7 +38,7 @@ bind-address = ":1000"
|
|||
[opentsdb]
|
||||
bind-address = ":2000"
|
||||
|
||||
[udp]
|
||||
[[udp]]
|
||||
bind-address = ":4444"
|
||||
|
||||
[monitoring]
|
||||
|
@ -69,8 +69,8 @@ enabled = true
|
|||
t.Fatalf("unexpected collectd bind address: %s", c.Collectd.BindAddress)
|
||||
} else if c.OpenTSDB.BindAddress != ":2000" {
|
||||
t.Fatalf("unexpected opentsdb bind address: %s", c.OpenTSDB.BindAddress)
|
||||
} else if c.UDP.BindAddress != ":4444" {
|
||||
t.Fatalf("unexpected udp bind address: %s", c.UDP.BindAddress)
|
||||
} else if c.UDPs[0].BindAddress != ":4444" {
|
||||
t.Fatalf("unexpected udp bind address: %s", c.UDPs[0].BindAddress)
|
||||
} else if c.Monitoring.Enabled != true {
|
||||
t.Fatalf("unexpected monitoring enabled: %v", c.Monitoring.Enabled)
|
||||
} else if c.ContinuousQuery.Enabled != true {
|
||||
|
|
|
@ -125,7 +125,9 @@ func NewServer(c *Config, version string) (*Server, error) {
|
|||
if err := s.appendOpenTSDBService(c.OpenTSDB); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s.appendUDPService(c.UDP)
|
||||
for _, g := range c.UDPs {
|
||||
s.appendUDPService(g)
|
||||
}
|
||||
s.appendRetentionPolicyService(c.Retention)
|
||||
for _, g := range c.Graphites {
|
||||
if err := s.appendGraphiteService(g); err != nil {
|
||||
|
|
|
@ -163,12 +163,12 @@ reporting-disabled = false
|
|||
# retention-policy = ""
|
||||
|
||||
###
|
||||
### [udp]
|
||||
### [[udp]]
|
||||
###
|
||||
### Controls the listener for InfluxDB line protocol data via UDP.
|
||||
### Controls the listeners for InfluxDB line protocol data via UDP.
|
||||
###
|
||||
|
||||
[udp]
|
||||
[[udp]]
|
||||
enabled = false
|
||||
# bind-address = ""
|
||||
# database = ""
|
||||
|
|
Loading…
Reference in New Issue