示例#1
0
func (w *writeBuffer) write(bp influxdb.BatchPoints) error {
	err := w.cli.Write(bp)
	if err != nil {
		w.i.writeErrors.Add(1)
		return err
	}
	w.i.pointsWritten.Add(int64(len(bp.Points())))
	return nil
}
示例#2
0
func (w *writeBuffer) write(bp influxdb.BatchPoints) error {
	var err error
	if w.conn == nil {
		if w.i.i.Cluster != "" {
			w.conn, err = w.i.et.tm.InfluxDBService.NewNamedClient(w.i.i.Cluster)
		} else {
			w.conn, err = w.i.et.tm.InfluxDBService.NewDefaultClient()
		}
		if err != nil {
			return err
		}
	}
	w.i.pointsWritten.Add(int64(len(bp.Points())))
	return w.conn.Write(bp)
}