// emits a series of datapoints
485027
func (w *datapointWorker) emit(token string) {
	// set the token on the HTTPSink
	w.sink.AuthToken = token
	w.stats.DPBatchSizes.Add(float64(len(w.buffer)))
	// emit datapoints and handle any errors
	err := w.sink.AddDatapoints(context.Background(), w.buffer)
	w.handleError(err, token, w.buffer, w.sink.AddDatapoints)
	// account for the emitted datapoints
	atomic.AddInt64(&w.stats.TotalDatapointsBuffered, int64(len(w.buffer)*-1))
	w.buffer = w.buffer[:0]
}
712823
func (e *EmptyMetricFilter) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {
	validDatapoints := e.FilterDatapoints(points)
	if len(validDatapoints) == 0 {
		return nil
	}
	return next.AddDatapoints(ctx, validDatapoints)
}
443688
func (f *ItemFlagger) SetDatapointFlags(ctx context.Context, points []*datapoint.Datapoint) {
	if f.CtxFlagCheck.HasFlag(ctx) {
		atomic.AddInt64(&f.stats.totalDpCtxSignals, 1)
		for _, dp := range points {
			f.SetDatapointFlag(dp)
		}
	}
	dims := f.GetDimensions()
	if len(dims) == 0 {
		return
	}
	for _, dp := range points {
		if dpMatches(dp, f.MetricDimensionName, dims) {
			atomic.AddInt64(&f.stats.totalDpDimSignals, 1)
			f.SetDatapointFlag(dp)
		}
	}
}
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
}
739417
func (q *PlanQueue) EmitStats(period time.Duration, stopCh chan struct{}) {
	for {
		select {
		case <-time.After(period):
			stats := q.Stats()
			metrics.SetGauge([]string{"nomad", "plan", "queue_depth"}, float32(stats.Depth))

		case <-stopCh:
			return
		}
	}
}
1123282
func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput {
	s.Datapoints = v
	return s
}
864939
func (forwarder *BufferedForwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) error {
	if forwarder.checker.CtxFlagCheck.HasFlag(ctx) {
		forwarder.cdim.With(ctx, forwarder.logger).Log("Datapoint call recieved in buffered forwarder")
	}
	atomic.AddInt64(&forwarder.stats.totalDatapointsBuffered, int64(len(points)))
	if *forwarder.config.MaxTotalDatapoints <= atomic.LoadInt64(&forwarder.stats.totalDatapointsBuffered) {
		atomic.AddInt64(&forwarder.stats.totalDatapointsBuffered, int64(-len(points)))
		return errDPBufferFull(forwarder.identifier)
	}
	select {
	case forwarder.dpChan <- points:
		return nil
	case <-forwarder.stopContext.Done():
		return forwarder.stopContext.Err()
	case <-ctx.Done():
		return ctx.Err()
	}
}
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)),
	}
}
550991
func (k *KafkaLogEmitter) Emit(logLine *avro.LogLine) {
	if logLine.Logtypeid.(int64) >= logLevels[k.config.LogLevel] {
		k.producer.Send(&producer.ProducerRecord{
			Topic: k.config.Topic,
			Value: logLine,
		})
	}
}
1285816
func (conn *Connection) Emit(event string, data interface{}) {
	conn.send <- &message{
		event: event,
		data:  data,
	}
}
666188
func DataPoint(obs float64, vars []float64) *dataPoint {
	return &dataPoint{Observed: obs, Variables: vars}
}
302182
func Emit(a app.App, event int, data interface{}) {
	a.ArgsScope().Trigger(event, nil)
	a.ConfigScope().Trigger(event, nil)
	a.EngineScope().Trigger(event, nil)
	a.CommandScope().Trigger(event, nil)
	a.DependencyScope().Trigger(event, nil)
	a.FilespaceScope().Trigger(event, nil)
	a.AppScope().Trigger(event, nil)
}
42695
func (decoder *JSONDecoder) Datapoints() []*datapoint.Datapoint {
	return []*datapoint.Datapoint{
		sfxclient.Cumulative("total_blank_dims", nil, atomic.LoadInt64(&decoder.TotalBlankDims)),
		sfxclient.Cumulative("invalid_collectd_json", nil, atomic.LoadInt64(&decoder.TotalErrors)),
	}
}
429698
func emitRows(rows []string) string {
	
	qb422016 := qt422016.AcquireByteBuffer()
	
	writeemitRows(qb422016, rows)
	
	qs422016 := string(qb422016.B)
	
	qt422016.ReleaseByteBuffer(qb422016)
	
	return qs422016

}
185302
func (z *ReadZipper) Datapoints() []*datapoint.Datapoint {
	return []*datapoint.Datapoint{
		sfxclient.CumulativeP("zipper.hitCount", nil, &z.HitCount),
		sfxclient.CumulativeP("zipper.missCount", nil, &z.MissCount),
		sfxclient.CumulativeP("zipper.newCount", nil, &z.NewCount),
		sfxclient.CumulativeP("zipper.errCount", nil, &z.ErrCount),
	}
}
551474
func (t *Events) Emit(e *api.Event) {
	t.ev = append(t.ev, e)
}
7025
func (e *RateLimitErrorLogging) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint, next Sink) error {
	err := next.AddDatapoints(ctx, points)
	e.throttleLog(err)
	return err
}