// add updates the stats with a new value
549848
func (s *poolStats) add(value, weight float64) {
	s.weight += weight
	s.sum += value * weight
	s.recalc()
}
899676
func (mc *CountersWithMultiLabels) Add(names []string, value int64) {
	if len(names) != len(mc.labels) {
		panic("CountersWithMultiLabels: wrong number of values in Add")
	}
	if value < 0 {
		logCounterNegative.Warningf("Adding a negative value to a counter, %v should be a gauge instead", mc)
	}

	mc.counters.Add(safeJoinLabels(names), value)
}
1035544
func (s *Stater) AddStat(m StatMetadata, h StatHandler) {
	s.ss = append(s.ss, stat{
		h: h,
		m: m,
	})
}
1268976
func (b *BarJSONBuilder) Add(info *BarPropertyInfo) *BarJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
760042
func (b *UpdateBuilder) Add(column string) *UpdateBuilder {
	return b.addValue(column, param(column))
}
991463
func (f *Flash) Add(key string, value interface{}) {
	if !f.changed {
		f.changed = true
	}
	if f.v == nil {
		f.v = make(data)
	}
	f.v[key] = append(f.v[key], value)
}
1012150
func (b *Builder) Add(defs ...Def) error {
	for _, def := range defs {
		if err := b.add(def); err != nil {
			return err
		}
	}

	return nil
}
815418
func (c *Counters) Add(name string, value int64) {
	c.mu.Lock()
	c.counts[name] += value
	c.mu.Unlock()
}
258398
func (d *Data) Add(key string, value string) {
	d.Values.Add(key, value)
}
1368245
func (s *Set) Add(val interface{}) bool {
	if s.data[val] {
		return false
	}

	s.data[val] = true
	s.values = append(s.values, val)
	return true
}
234623
func (b *InsertBuilder) Add(vals ...interface{}) *InsertBuilder {
	var rows Values
	if b.Insert.Rows != nil {
		rows = b.Insert.Rows.(Values)
	}
	b.Insert.Rows = append(rows, makeValTuple(vals))
	return b
}
253953
func (w *Wait) Add() {
	curr := atomic.LoadInt64(&w.totalCount)

	if curr < 0 {
		return
	}

	atomic.AddInt64(&w.totalCount, 1)
}
1166141
func (s *stats) update(channel string, eventID int64) {
	s.Lock()
	if _, ok := s.ChannelStats[channel]; !ok {
		s.ChannelStats[channel] = make(eventIDStat)
	}
	s.ChannelStats[channel][eventID]++
	s.EventCount++
	s.Unlock()
}
1093996
func (eng *Engine) Add(name string, value interface{}, tags ...Tag) {
	eng.measure(time.Now(), name, value, Counter, tags...)
}
1345670
func (t *Timings) Add(name string, elapsed time.Duration) {
	// Get existing Histogram.
	t.mu.RLock()
	hist, ok := t.histograms[name]
	hook := t.hook
	t.mu.RUnlock()

	// Create Histogram if it does not exist.
	if !ok {
		t.mu.Lock()
		hist, ok = t.histograms[name]
		if !ok {
			hist = NewGenericHistogram("", "", bucketCutoffs, bucketLabels, "Count", "Time")
			t.histograms[name] = hist
		}
		t.mu.Unlock()
	}

	elapsedNs := int64(elapsed)
	hist.Add(elapsedNs)
	t.totalCount.Add(1)
	t.totalTime.Add(elapsedNs)
	if hook != nil {
		hook(name, elapsed)
	}
}
1359502
func (s *IncrementStat) Add(delta int64) {
	s.m.Lock()
	defer s.m.Unlock()
	if !s.isStarted {
		return
	}
	s.c += delta
}
1138669
func (t *Timings) Add(name string, elapsed time.Duration) {
	t.mu.Lock()
	defer t.mu.Unlock()

	hist, ok := t.histograms[name]
	if !ok {
		hist = NewGenericHistogram("", bucketCutoffs, bucketLabels, "Count", "Time")
		t.histograms[name] = hist
	}
	elapsedNs := int64(elapsed)
	hist.Add(elapsedNs)
	t.totalCount++
	t.totalTime += elapsedNs
}