Hello,

I am using the influxdb golang client to write points. 

I am adding points to a batch and then frequently writing the batch to the 
DB. My question is - for the next batch, do I create a new batch from 
scratch and just disregard the old batch ?

It would be nice if the API had a clearPoints() API along with AddPoint() 
and AddPoints(). Then I can just clear the old points and add new points.

This is my code -


type influxDBOutput struct {
 client influxdb.Client
 batchPts influxdb.BatchPoints
 database string
 precision string
 metric string
}

func (i *influxDBOutput) Flush() error {
 // Flushing the current batch
 i.client.Write(i.batchPts)
 // Creating new batch
 bp, err := getNewBatch(i.database, i.precision)
 if err != nil {
 return err
 }
 i.batchPts = bp // <---- Replacing the old batch variable with the new one
 return nil
}


-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/73de7ff8-eb3d-4db7-817e-c79446c53434%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to