// Datapoints reports information about the total points seen by wavefront
334962
func (listener *Listener) Datapoints() []*datapoint.Datapoint {
	return []*datapoint.Datapoint{
		sfxclient.Cumulative("invalid_datapoints", nil, atomic.LoadInt64(&listener.stats.invalidDatapoints)),
		sfxclient.Cumulative("total_connections", nil, atomic.LoadInt64(&listener.stats.totalConnections)),
		sfxclient.Gauge("active_connections", nil, atomic.LoadInt64(&listener.stats.activeConnections)),
		sfxclient.Cumulative("idle_timeouts", nil, atomic.LoadInt64(&listener.stats.idleTimeouts)),
		sfxclient.Cumulative("retry_listen_errors", nil, atomic.LoadInt64(&listener.stats.retriedListenErrors)),
	}
}
537388
func (s *ListenerServer) Datapoints() []*datapoint.Datapoint {
	return append(s.collector.Datapoints(), s.HealthDatapoints()...)
}
914579
func (h *HistoCounter) Datapoints() []*datapoint.Datapoint {
	dps := h.sink.Datapoints()
	dps = append(dps, h.DatapointBucket.Datapoints()...)
	dps = append(dps, h.EventBucket.Datapoints()...)
	dps = append(dps, h.SpanBucket.Datapoints()...)
	return dps
}
1005929
func sendDataPoints(data []dataPoint) error {
	json, err := json.Marshal(data)
	if err != nil {
		return err
	}

	resp, err := http.Post(*openTsdbURI, "application/json", bytes.NewReader(json))
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}
842463
func (connector *Forwarder) Datapoints() []*datapoint.Datapoint {
	dps := connector.stats.requests.Datapoints()
	dps = append(dps, connector.stats.drainSize.Datapoints()...)
	dps = append(dps, connector.GetFilteredDatapoints()...)
	dps = append(dps, connector.sampler.Datapoints()...)
	return dps
}
204180
func (t *TagReplace) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) error {
	return t.next.AddDatapoints(ctx, points)
}
677950
func (e *G1) CurvePoints() (*big.Int, *big.Int, *big.Int, *big.Int) {
	return e.p.x, e.p.y, e.p.z, e.p.t
}
1052495
func (w *WithDimensions) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {
	return next.AddDatapoints(ctx, w.appendDimensions(points))
}
108799
func (c *ScatterChart) clipPoint(in, out EPoint, min, max float64) (p EPoint) {
	// fmt.Printf("clipPoint: in (%g,%g), out(%g,%g)  min/max=%g/%g\n", in.X, in.Y, out.X, out.Y, min, max)
	dx, dy := in.X-out.X, in.Y-out.Y

	var y float64
	if out.Y <= min {
		y = min
	} else {
		y = max
	}
	x := in.X + dx*(y-in.Y)/dy
	p.X, p.Y = x, y
	p.DeltaX, p.DeltaY = math.NaN(), math.NaN()
	return
}
1220621
func (h *HistoCounter) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {
	h.DatapointBucket.Add(float64(len(points)))
	return h.sink.AddDatapoints(ctx, points, next)
}
528805
func (c *Counter) Datapoints() []*datapoint.Datapoint {
	var dims map[string]string
	if c.DroppedReason != "" {
		dims = map[string]string{"reason": c.DroppedReason}
	}
	return []*datapoint.Datapoint{
		sfxclient.Cumulative("total_process_errors", nil, atomic.LoadInt64(&c.TotalProcessErrors)),
		sfxclient.Cumulative("total_datapoints", nil, atomic.LoadInt64(&c.TotalDatapoints)),
		sfxclient.Cumulative("total_events", nil, atomic.LoadInt64(&c.TotalEvents)),
		sfxclient.Cumulative("total_spans", nil, atomic.LoadInt64(&c.TotalSpans)),
		sfxclient.Cumulative("total_process_calls", nil, atomic.LoadInt64(&c.TotalProcessCalls)),
		sfxclient.Cumulative("dropped_points", dims, atomic.LoadInt64(&c.ProcessErrorPoints)),
		sfxclient.Cumulative("dropped_events", dims, atomic.LoadInt64(&c.ProcessErrorEvents)),
		sfxclient.Cumulative("dropped_spans", dims, atomic.LoadInt64(&c.ProcessErrorSpans)),
		sfxclient.Cumulative("process_time_ns", nil, atomic.LoadInt64(&c.TotalProcessTimeNs)),
		sfxclient.Gauge("calls_in_flight", nil, atomic.LoadInt64(&c.CallsInFlight)),
	}
}
63073
func (gp *GoPdf) UnitsToPoints(u float64) float64 {
	return UnitsToPoints(gp.config.Unit, u)
}
1114202
func (s *SHA1Reporter) Datapoints() []*datapoint.Datapoint {
	s.loadFileInfo()
	return []*datapoint.Datapoint{
		sfxclient.Gauge("fileinfo_commit", map[string]string{"commit": s.Fi.Commit}, int64(1)),
	}
}
1312700
func (s *ClientConfigChangerSink) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) error {
	s.mu.RLock()
	defer s.mu.RUnlock()
	return s.Destination.AddDatapoints(ctx, points)
}
1367925
func (listener *Listener) fromWavefrontDatapoint(line string) *datapoint.Datapoint {
	pieces := getMetricPieces(line)
	if len(pieces) < 3 {
		return nil
	}
	metricName, dimensions := extractCollectdDimensions(listener.extractCollectdDimensions, stripQuotes(pieces[0]))

	valueString := pieces[1]

	var value datapoint.Value
	if i, err := strconv.ParseInt(valueString, 10, 64); err == nil {
		value = datapoint.NewIntValue(i)
	} else if f, err := strconv.ParseFloat(valueString, 64); err == nil {
		value = datapoint.NewFloatValue(f)
	} else {
		return nil
	}
	var timestamp time.Time
	epoch, err := strconv.ParseInt(pieces[2], 10, 64)
	if err != nil {
		// probably not the timestamp, probably a dimension
		pieces = pieces[2:]
		timestamp = time.Now()
	} else {
		timestamp = time.Unix(epoch, 0)
		pieces = pieces[3:]
	}
	for _, p := range pieces {
		dimPieces := strings.SplitN(p, "=", 2)
		if len(dimPieces) == 2 {
			key := dimPieces[0]
			value := stripQuotes(dimPieces[1])
			dimensions[key] = value
		}
		// ignore malformed dimensions
	}
	return datapoint.New(metricName, dimensions, value, datapoint.Gauge, timestamp)
}
703795
func (s GeoDistanceSort) Points(points ...*GeoPoint) GeoDistanceSort {
	s.points = append(s.points, points...)
	return s
}
1127535
func (s *PutMetricAlarmInput) SetDatapointsToAlarm(v int64) *PutMetricAlarmInput {
	s.DatapointsToAlarm = &v
	return s
}