// Total - Send a metric that is continously increasing, e.g. read operations since boot
766353
func (s *StdoutClient) Total(stat string, value int64) error {
	return s.send(stat, "%d|t", value)
}
991648
func (ct *costTracker) totalRecharge() uint64 {
	ct.gfLock.RLock()
	defer ct.gfLock.RUnlock()

	return uint64(ct.gf * ct.utilTarget)
}
1272296
func (s *IndicesStatsService) Metric(metric ...string) *IndicesStatsService {
	s.metric = append(s.metric, metric...)
	return s
}
1360067
func (s *NodesStatsService) Metric(metric ...string) *NodesStatsService {
	s.metric = append(s.metric, metric...)
	return s
}
477621
func (m *Metrics) Add(r *Result) {
	m.init()

	m.Requests++
	m.StatusCodes[strconv.Itoa(int(r.Code))]++
	m.BytesOut.Total += r.BytesOut
	m.BytesIn.Total += r.BytesIn

	m.Latencies.Add(r.Latency)

	if m.Earliest.IsZero() || m.Earliest.After(r.Timestamp) {
		m.Earliest = r.Timestamp
	}

	if r.Timestamp.After(m.Latest) {
		m.Latest = r.Timestamp
	}

	if end := r.End(); end.After(m.End) {
		m.End = end
	}

	if r.Code >= 200 && r.Code < 400 {
		m.success++
	}

	if r.Error != "" {
		if _, ok := m.errors[r.Error]; !ok {
			m.errors[r.Error] = struct{}{}
			m.Errors = append(m.Errors, r.Error)
		}
	}
}
1077836
func (m *MeterStats) WriteTo(w io.Writer) (int64, error) {
	var buf bytes.Buffer

	// Write the list of meter band statistics into
	// the temporary buffer to calculate the total
	// message length.
	_, err := encoding.WriteSliceTo(&buf, m.BandStats)
	if err != nil {
		return 0, err
	}

	length := uint16(meterStatsLen + buf.Len())

	return encoding.WriteTo(w, m.Meter, length, pad6{},
		m.FlowCount, m.PacketInCount, m.ByteInCount,
		m.DurationSec, m.DurationNSec, buf.Bytes())
}
1283782
func (s *Server) SendMetrics(ctx context.Context, mlist *forwardrpc.MetricList) (*empty.Empty, error) {
	go func() {
		// Track the number of active goroutines in a counter
		atomic.AddInt64(s.activeProxyHandlers, 1)
		_ = s.sendMetrics(context.Background(), mlist)
		atomic.AddInt64(s.activeProxyHandlers, -1)
	}()
	return &empty.Empty{}, nil
}
808807
func totalSize(f []fileMetadata) (size uint64) {
	for _, x := range f {
		size += x.size
	}
	return size
}
987634
func (v *priorityClientPool) totalCapacity() uint64 {
	v.lock.Lock()
	defer v.lock.Unlock()

	return v.totalCapAnnounced
}
41650
func (d *DefaultMetricCollector) TotalDuration() *rolling.Timing {
	d.mutex.RLock()
	defer d.mutex.RUnlock()
	return d.totalDuration
}
1352835
func (s *XPackWatcherStatsService) Metric(metric string) *XPackWatcherStatsService {
	s.metric = metric
	return s
}
225451
func (a *AzureMonitor) Push() []telegraf.Metric {
	var metrics []telegraf.Metric
	for tbucket, aggs := range a.cache {
		// Do not send metrics early
		if tbucket.After(a.timeFunc().Add(-time.Minute)) {
			continue
		}
		for _, agg := range aggs {
			// Only send aggregates that have had an update since the last push.
			if !agg.updated {
				continue
			}

			tags := make(map[string]string, len(agg.dimensions))
			for _, tag := range agg.dimensions {
				tags[tag.name] = tag.value
			}

			m, err := metric.New(agg.name,
				tags,
				map[string]interface{}{
					"min":   agg.min,
					"max":   agg.max,
					"sum":   agg.sum,
					"count": agg.count,
				},
				tbucket,
			)

			if err != nil {
				log.Printf("E! [outputs.azure_monitor]: could not create metric for aggregation %q; discarding point", agg.name)
			}

			metrics = append(metrics, m)
		}
	}
	return metrics
}
542565
func (s *svc2) Sum(ctx context.Context, a int64, b int64) (int64, error) {
	// We love starting up slow
	time.Sleep(5 * time.Millisecond)

	// Pull span from context.
	span := opentracing.SpanFromContext(ctx)

	// Example binary annotations.
	span.SetTag("service", "svc2")
	span.SetTag("string", "some value")
	span.SetTag("int", 123)
	span.SetTag("bool", true)

	// Example annotation
	span.LogEvent("MyEventAnnotation")

	// Let's wait a little so it shows up nicely in our tracing graphics.
	time.Sleep(10 * time.Millisecond)

	// Let's assume we want to trace a call we do to a database.
	s.fakeDBCall(span)

	// Check for Int overflow condition.
	if (b > 0 && a > (Int64Max-b)) || (b < 0 && a < (Int64Min-b)) {
		span.SetTag("error", ErrIntOverflow.Error())
		return 0, ErrIntOverflow
	}

	// calculate and return the result (all that boilerplate for this?) ;)
	return a + b, nil
}
943854
func (s *ResultByTime) SetTotal(v map[string]*MetricValue) *ResultByTime {
	s.Total = v
	return s
}
1121589
func metadataTotalLength(types []byte) int {
	sum := 0
	for _, t := range types {
		sum += metadataLength(t)
	}
	return sum
}
1042718
func Sum(out *[TagSize]byte, msg []byte, key *[16]byte) {
	(*[1]uint64)(unsafe.Pointer(&out[0]))[0] = Sum64(msg, key)
}
1303350
func Sum(data []byte) [Size]byte {
	imo := New()
	return imo.Sum(data)
}