Skip to content

Commit

Permalink
InfluxDB does not accept uint64, so cast them down to int64
Browse files Browse the repository at this point in the history
Fixes #290
  • Loading branch information
sparrc committed Oct 20, 2015
1 parent 6869362 commit f7504fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ func (bp *BatchPoints) AddFields(
bp.Lock()
defer bp.Unlock()

// InfluxDB does not support writing uint64
for k, v := range fields {
switch val := v.(type) {
case uint64:
if val < uint64(9223372036854775808) {
fields[k] = int64(val)
}
}
}

measurement = bp.Prefix + measurement

if bp.Config != nil {
Expand Down

0 comments on commit f7504fb

Please sign in to comment.