Skip to content

Commit

Permalink
Change influxdb stats to not count points written on error (influxdat…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Cook authored Aug 10, 2016
1 parent 7365249 commit 6ce1a61
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions influxdb_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ func (w *writeBuffer) writeAll() {
for bpc, bp := range w.buffer {
err := w.write(bp)
if err != nil {
w.i.writeErrors.Add(1)
w.i.logger.Println("E! failed to write points to InfluxDB:", err)
}
delete(w.buffer, bpc)
Expand All @@ -249,9 +248,15 @@ func (w *writeBuffer) write(bp influxdb.BatchPoints) error {
w.conn, err = w.i.et.tm.InfluxDBService.NewDefaultClient()
}
if err != nil {
w.i.writeErrors.Add(1)
return err
}
}
err = w.conn.Write(bp)
if err != nil {
w.i.writeErrors.Add(1)
return err
}
w.i.pointsWritten.Add(int64(len(bp.Points())))
return w.conn.Write(bp)
return nil
}

0 comments on commit 6ce1a61

Please sign in to comment.