Skip to content

Commit

Permalink
Do not write metrics if there are 0 to write
Browse files Browse the repository at this point in the history
closes #884
  • Loading branch information
sparrc committed Mar 18, 2016
1 parent f2394b5 commit ec66f9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/models/running_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (ro *RunningOutput) Write() error {
}

func (ro *RunningOutput) write(metrics []telegraf.Metric) error {
if len(metrics) == 0 {
return nil
}
start := time.Now()
err := ro.Output.Write(metrics)
elapsed := time.Since(start)
Expand Down

0 comments on commit ec66f9a

Please sign in to comment.