Skip to content

Commit

Permalink
Ping input doesn't return response time metric when timeout
Browse files Browse the repository at this point in the history
closes #506
  • Loading branch information
titilambert authored and sparrc committed Jan 14, 2016
1 parent 3c89847 commit 3cc1fec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
## v0.10.0 [unreleased]
## v0.10.1 [unreleased]

### Features
- [#509](https://github.com/influxdb/telegraf/pull/509): Flatten JSON arrays with indices. Thanks @psilva261!

### Bugfixes
- [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert!

## v0.10.0 [2014-01-12]

### Release Notes
- Linux packages have been taken out of `opt`, the binary is now in `/usr/bin`
Expand Down
4 changes: 3 additions & 1 deletion plugins/inputs/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ func (p *Ping) Gather(acc inputs.Accumulator) error {
"packets_transmitted": trans,
"packets_received": rec,
"percent_packet_loss": loss,
"average_response_ms": avg,
}
if avg > 0 {
fields["average_response_ms"] = avg
}
acc.AddFields("ping", fields, tags)
}(url, acc)
Expand Down
1 change: 0 additions & 1 deletion plugins/inputs/ping/ping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func TestBadPingGather(t *testing.T) {
"packets_transmitted": 2,
"packets_received": 0,
"percent_packet_loss": 100.0,
"average_response_ms": 0.0,
}
acc.AssertContainsTaggedFields(t, "ping", fields, tags)
}
Expand Down

0 comments on commit 3cc1fec

Please sign in to comment.