// Add adds a value to a named counter.
543472
func (c *CountersWithSingleLabel) Add(name string, value int64) {
	if value < 0 {
		logCounterNegative.Warningf("Adding a negative value to a counter, %v should be a gauge instead", c)
	}
	a := c.getValueAddr(name)
	atomic.AddInt64(a, value)
}
968459
func (args Args) Add(key, value string) {
	args[key] = append(args[key], value)
}
90360
func (b *Builder) Add(name string, data Slice) *Builder {
	if data == nil {
		// Remove the column.
		if _, ok := b.t.cols[name]; !ok {
			if _, ok := b.t.consts[name]; !ok {
				// Nothing to remove.
				return b
			}
		}
		delete(b.t.cols, name)
		delete(b.t.consts, name)
		for i, n := range b.t.colNames {
			if n == name {
				copy(b.t.colNames[i:], b.t.colNames[i+1:])
				b.t.colNames = b.t.colNames[:len(b.t.colNames)-1]
				break
			}
		}
		return b
	}

	// Are we replacing an existing column?
	_, replace := b.t.cols[name]
	if !replace {
		_, replace = b.t.consts[name]
	}

	// Check the column and add it.
	rv := reflectSlice(data)
	dataLen := rv.Len()
	if len(b.t.cols) == 0 || (replace && len(b.t.cols) == 1) {
		if b.t.cols == nil {
			b.t.cols = make(map[string]Slice)
		}
		// First non-constant column (possibly replacing the
		// only non-constant column).
		b.t.cols[name] = data
		b.t.len = dataLen
	} else if b.t.len != dataLen {
		panic(fmt.Sprintf("cannot add column %q with %d elements to table with %d rows", name, dataLen, b.t.len))
	} else {
		b.t.cols[name] = data
	}

	if replace {
		// Make sure it's not in constants.
		delete(b.t.consts, name)
	} else {
		b.t.colNames = append(b.t.colNames, name)
	}

	return b
}
98357
func (w *filePoller) Add(name string) error {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.closed {
		return errPollerClosed
	}

	f, err := os.Open(name)
	if err != nil {
		return err
	}
	fi, err := os.Stat(name)
	if err != nil {
		return err
	}

	if w.watches == nil {
		w.watches = make(map[string]chan struct{})
	}
	if _, exists := w.watches[name]; exists {
		return fmt.Errorf("watch exists")
	}
	chClose := make(chan struct{})
	w.watches[name] = chClose
	go w.watch(f, fi, chClose)
	return nil
}
745214
func (b Builder) Add(elems ...int) {
	if b.done {
		return
	}
	for _, elem := range elems {
		b.result.elems[elem] = struct{}{}
	}
}
1086050
func (s *stringSet) Add(vs ...string) {
	for _, v := range vs {
		s.values[v] = struct{}{}
	}
}
876342
func (f *Values) Add(key, val string) {
	f.values = append(f.values, formValue{key, val})
}
1117287
func (c CPUMap) Add(q CPUMap) {
	for label, value := range q {
		if _, ok := c[label]; !ok {
			c[label] = value
		} else {
			c[label] += value
		}
	}
}
599260
func (r *ResetTimer) Add() {
	r.lock.Lock()
	defer r.lock.Unlock()
	state := int(atomic.LoadInt64(&r.state))
	// startd := int(atomic.LoadInt64(&r.started))

	if r.kill == nil {
		r.kill = make(chan struct{})
	}

	if r.reset == nil {
		r.reset = make(chan struct{})
	}

	if state > 0 {
		r.reset <- struct{}{}
	} else {
		r.runInit()
		r.handle()
		atomic.StoreInt64(&r.state, 1)
		atomic.StoreInt64(&r.started, 1)
	}
}
604334
func (s *ProcessingStats) Add(counter *uint64, amount int) {
	atomic.AddUint64(counter, uint64(amount))
}
389313
func (l builtList) Add(name string) builtList {
	if l == nil {
		return builtList{name: 0}
	}
	l[name] = len(l)
	return l
}
505118
func (d *Duration) Add(n time.Duration) time.Duration {
	return time.Duration(d.v.Add(int64(n)))
}
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)
	}
}
3231
func (s MeasurementStats) Add(other MeasurementStats) {
	for name, v := range other {
		s[name] += v
	}
}
253953
func (w *Wait) Add() {
	curr := atomic.LoadInt64(&w.totalCount)

	if curr < 0 {
		return
	}

	atomic.AddInt64(&w.totalCount, 1)
}
373702
func (i *Int32) Add(n int32) int32 {
	return atomic.AddInt32(&i.v, n)
}
1184393
func (s *set) Add(vs ...interface{}) {
	for _, v := range vs {
		s.values[v] = struct{}{}
	}
}