Beispiel #1
0
// WritePoint writes a single point to the Proxy.
func (w *Proxy) WritePoint(key string, when time.Time, tags dagr.Tags, fields dagr.Fields) (n int64, err error) {
	if key == "" {
		logf("Empty key in point")
		return 0, dagr.ErrEmptyKey
	} else if len(fields) == 0 {
		logf("No fields in point %q", key)
		return 0, dagr.ErrNoFields
	}

	if when.IsZero() {
		when = time.Now()
	}

	return dagr.WriteMeasurement(w, dagr.RawPoint{key, tags, fields, when})
}
Beispiel #2
0
// WriteMeasurement writes a single measurement to the Proxy.
func (w *Proxy) WriteMeasurement(measurement dagr.Measurement) (n int64, err error) {
	return dagr.WriteMeasurement(w, measurement)
}