velodrome/token-counter/influx.go
func (i *InfluxDB) Push(measurement string, tags map[string]string, fields map[string]interface{}, date time.Time) error {
	batch, err := influxdb.NewBatchPoints(influxdb.BatchPointsConfig{
		Database:  i.database,
		Precision: "s",
	})
	if err != nil {
		return err
	}

	pt, err := influxdb.NewPoint(measurement, tags, fields, date)
	if err != nil {
		return err
	}

	batch.AddPoint(pt)

	err = i.client.Write(batch)
	if err != nil {
		return err
	}
	glog.Infof("Sent to influx: %s %+v %+v %s", measurement, tags, fields, date)

	return nil
}
func (i *InfluxDB) Push(measurement string, tags map[string]string, fields map[string]interface{}, date time.Time) error {
	batch, err := influxdb.NewBatchPoints(influxdb.BatchPointsConfig{
		Database:  i.database,
		Precision: "s",
	})
	if err != nil {
		return err
	}

	pt, err := influxdb.NewPoint(measurement, tags, fields, date)
	if err != nil {
		return err
	}

	batch.AddPoint(pt)

	err = i.client.Write(batch)
	if err != nil {
		return err
	}
	glog.Infof("Sent to influx: %s %+v %+v %s", measurement, tags, fields, date)

	return nil
}
func ( i * InfluxDB ) Push ( measurement string , tags map [ string ] string , fields map [ string ] interface { } , date time . Time ) error { batch , err := influxdb . NewBatchPoints ( influxdb . BatchPointsConfig { Database : i . database , Precision : " " , } ) if err != nil { return err } pt , err := influxdb . NewPoint ( measurement , tags , fields , date ) if err != nil { return err } batch . AddPoint ( pt ) err = i . client . Write ( batch ) if err != nil { return err } glog . Infof ( " " , measurement , tags , fields , date ) return nil }
// Push a point to the database
Push a point to the database