// Datapoints returns active connections plus wrapped bucket stats
771073
func (m *BucketRequestCounter) Datapoints() []*datapoint.Datapoint {
	dps := m.Bucket.Datapoints()
	return append(dps,
		sfxclient.Gauge(m.Bucket.MetricName+".active_connections", m.Bucket.Dimensions, atomic.LoadInt64(&m.ActiveConnections)),
	)
}
1123282
func (s *GetMetricStatisticsOutput) SetDatapoints(v []*Datapoint) *GetMetricStatisticsOutput {
	s.Datapoints = v
	return s
}
1362713
func (s *endpointsLister) Endpoints(namespace string) EndpointsNamespaceLister {
	return endpointsNamespaceLister{indexer: s.indexer, namespace: namespace}
}
216833
func (c *Client) GetDatasets(ctx context.Context) (m ModelCollection, err error) {
	uri := fmt.Sprintf("%s/datasets", c.url)

	clientlog.Do(ctx, "retrieving datasets", service, uri)

	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		return
	}

	resp, err := c.cli.Do(ctx, req)
	if err != nil {
		return
	}

	if resp.StatusCode != http.StatusOK {
		err = NewDatasetAPIResponse(resp, uri)
		return
	}

	b, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return
	}
	defer resp.Body.Close()

	var body map[string]interface{}
	if err = json.Unmarshal(b, &body); err != nil {
		return
	}

	return
}
373007
func (a *api) GetEndpoints(serviceID string, reportImports, reportExports, validate bool) ([]applicationendpoint.EndpointReport, error) {
	client, err := a.connectMaster()
	if err != nil {
		return nil, err
	}

	serviceIDs := make([]string, 0)
	serviceIDs = append(serviceIDs, serviceID)
	if endpoints, err := client.GetServiceEndpoints(serviceIDs, reportImports, reportExports, validate); err != nil {
		return nil, err
	} else {
		return endpoints, nil
	}
}
876189
func (streamer *Demultiplexer) Datapoints() []*datapoint.Datapoint {
	var dps []*datapoint.Datapoint
	if streamer.FutureDuration != nil {
		dps = append(dps, []*datapoint.Datapoint{
			sfxclient.Cumulative("future.count", map[string]string{"type": "datapoint"}, atomic.LoadInt64(&streamer.stats.futureDps)),
			sfxclient.Cumulative("future.count", map[string]string{"type": "event"}, atomic.LoadInt64(&streamer.stats.futureEvents)),
			sfxclient.Cumulative("future.count", map[string]string{"type": "spans"}, atomic.LoadInt64(&streamer.stats.futureSpans)),
		}...)
	}
	if streamer.LateDuration != nil {
		dps = append(dps, []*datapoint.Datapoint{
			sfxclient.Cumulative("late.count", map[string]string{"type": "datapoint"}, atomic.LoadInt64(&streamer.stats.lateDps)),
			sfxclient.Cumulative("late.count", map[string]string{"type": "event"}, atomic.LoadInt64(&streamer.stats.lateEvents)),
			sfxclient.Cumulative("late.count", map[string]string{"type": "spans"}, atomic.LoadInt64(&streamer.stats.lateSpans)),
		}...)
	}
	return dps
}
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)),
	}
}
615557
func ConnectStats(stats adapter.StatsAPI) (*StatsConnection, error) {
	c := newStatsConnection(stats)

	if err := c.connectClient(); err != nil {
		return nil, err
	}

	return c, nil
}
45793
func (s *Scheduler) CollectDatapoints() []*datapoint.Datapoint {
	ret := make([]*datapoint.Datapoint, 0, len(s.previousDatapoints))
	now := s.Timer.Now()
	for _, p := range s.callbackMap {
		ret = append(ret, p.getDatapoints(now, s.SendZeroTime)...)
	}
	return ret
}
1330504
func statValuesToDatapoints(vals []IOStatValue, prefix string, tags map[string]string, ts string) []producers.Datapoint {
	var datapoints []producers.Datapoint
	for _, s := range vals {
		op := strings.ToLower(s.Operation)
		d := producers.Datapoint{
			Name:      prefix + "." + op,
			Value:     s.Value,
			Tags:      tags,
			Timestamp: ts,
			Unit:      bytes,
		}
		datapoints = append(datapoints, d)
	}
	return datapoints
}
666188
func DataPoint(obs float64, vars []float64) *dataPoint {
	return &dataPoint{Observed: obs, Variables: vars}
}
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)),
	}
}
1082549
func (s *Server) Datapoints() []*datapoint.Datapoint {
	return append(s.collector.Datapoints(), s.HealthDatapoints()...)
}
1084205
func (t *AvailService) DataCenters() (*AvailDataCentersResponse, error) {
	u := &url.Values{}
	v := AvailDataCentersResponse{}
	if err := t.client.do("avail.datacenters", u, &v.Response); err != nil {
		return nil, err
	}
	v.DataCenters = make([]DataCenter, 5)
	if err := json.Unmarshal(v.RawData, &v.DataCenters); err != nil {
		return nil, err
	}
	return &v, nil
}
1002868
func (e *ErrorTrackerHandler) Datapoints() []*datapoint.Datapoint {
	return []*datapoint.Datapoint{
		sfxclient.Cumulative("total_errors", nil, atomic.LoadInt64(&e.TotalErrors)),
	}
}
723639
func (m MultiCollector) Datapoints() []*datapoint.Datapoint {
	var ret []*datapoint.Datapoint
	for _, col := range m {
		ret = append(ret, col.Datapoints()...)
	}
	return ret
}
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)
}