Skip to content

Commit

Permalink
Update README, CHANGELOG, and unit tests with list output
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc committed Nov 16, 2015
1 parent 3750459 commit 5664625
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ changed to just run docker commands in the Makefile. See `make docker-run` and
- HAProxy plugin tag has changed from `host` to `server`
- UDP output now supported
- Telegraf will now compile on FreeBSD
- Users can now specify outputs as lists, specifying multiple outputs of the
same type.

### Features
- [#325](https://github.com/influxdb/telegraf/pull/325): NSQ output. Thanks @jrxFive!
Expand All @@ -19,6 +21,7 @@ changed to just run docker commands in the Makefile. See `make docker-run` and
- [#365](https://github.com/influxdb/telegraf/pull/365): Twemproxy plugin by @codeb2cc
- [#317](https://github.com/influxdb/telegraf/issues/317): ZFS plugin, thanks @cornerot!
- [#364](https://github.com/influxdb/telegraf/pull/364): Support InfluxDB UDP output.
- [#370](https://github.com/influxdb/telegraf/pull/370): Support specifying multiple outputs, as lists.
- [#372](https://github.com/influxdb/telegraf/pull/372): Remove gosigar and update go-dockerclient for FreeBSD support. Thanks @MerlinDMC!

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ measurements at a 10s interval and will collect totalcpu & percpu data.
# OUTPUTS
[outputs]
[outputs.influxdb]
[[outputs.influxdb]]
url = "http://192.168.59.103:8086" # required.
database = "telegraf" # required.
precision = "s"
Expand Down
10 changes: 5 additions & 5 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ func TestAgent_LoadOutput(t *testing.T) {
a, _ := NewAgent(config)

outputsEnabled, _ := a.LoadOutputs([]string{"influxdb"}, config)
assert.Equal(t, 1, len(outputsEnabled))
assert.Equal(t, 2, len(outputsEnabled))

outputsEnabled, _ = a.LoadOutputs([]string{}, config)
assert.Equal(t, 2, len(outputsEnabled))
assert.Equal(t, 3, len(outputsEnabled))

outputsEnabled, _ = a.LoadOutputs([]string{"foo"}, config)
assert.Equal(t, 0, len(outputsEnabled))

outputsEnabled, _ = a.LoadOutputs([]string{"influxdb", "foo"}, config)
assert.Equal(t, 1, len(outputsEnabled))
assert.Equal(t, 2, len(outputsEnabled))

outputsEnabled, _ = a.LoadOutputs([]string{"influxdb", "kafka"}, config)
assert.Equal(t, 2, len(outputsEnabled))
assert.Equal(t, 3, len(outputsEnabled))

outputsEnabled, _ = a.LoadOutputs([]string{"influxdb", "foo", "kafka", "bar"}, config)
assert.Equal(t, 2, len(outputsEnabled))
assert.Equal(t, 3, len(outputsEnabled))
}

func TestAgent_ZeroJitter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion etc/config.sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
[outputs]

# Configuration for influxdb server to send metrics to
[outputs.influxdb]
[[outputs.influxdb]]
# The full HTTP endpoint URL for your InfluxDB instance
# Multiple urls can be specified for InfluxDB cluster support. Server to
# write to will be randomly chosen each interval.
Expand Down
8 changes: 6 additions & 2 deletions testdata/telegraf-agent.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
[outputs]

# Configuration for influxdb server to send metrics to
[outputs.influxdb]
[[outputs.influxdb]]
# The full HTTP endpoint URL for your InfluxDB instance
# Multiple urls can be specified for InfluxDB cluster support. Server to
# write to will be randomly chosen each interval.
Expand All @@ -69,8 +69,12 @@
# Set the user agent for the POSTs (can be useful for log differentiation)
# user_agent = "telegraf"

[[outputs.influxdb]]
urls = ["udp://localhost:8089"]
database = "udp-telegraf"

# Configuration for the Kafka server to send metrics to
[outputs.kafka]
[[outputs.kafka]]
# URLs of kafka brokers
brokers = ["localhost:9092"]
# Kafka topic for producer messages
Expand Down

0 comments on commit 5664625

Please sign in to comment.