InfluxDB does not accept uint64, so cast them down to int64

Fixes #290
This commit is contained in:
Cameron Sparr 2015-10-19 18:43:40 -06:00
parent 6869362f43
commit f7504fb5eb
1 changed files with 10 additions and 0 deletions

View File

@ -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 {