// Add icnrements the `p` value of the decaying error object
511356
func (decaying *Decaying) Add(d float64) {
	prevVal := decaying.Value()
	decaying.Lock()
	decaying.p = prevVal + d
	decaying.Unlock()
}
1311387
func (c *Scratch) Add(key string, newAddend interface{}) (string, error) {

	var newVal interface{}
	c.mu.RLock()
	existingAddend, found := c.values[key]
	c.mu.RUnlock()
	if found {
		var err error

		addendV := reflect.TypeOf(existingAddend)

		if addendV.Kind() == reflect.Slice || addendV.Kind() == reflect.Array {
			newVal, err = collections.Append(existingAddend, newAddend)
			if err != nil {
				return "", err
			}
		} else {
			newVal, err = math.DoArithmetic(existingAddend, newAddend, '+')
			if err != nil {
				return "", err
			}
		}
	} else {
		newVal = newAddend
	}
	c.mu.Lock()
	c.values[key] = newVal
	c.mu.Unlock()
	return "", nil // have to return something to make it work with the Go templates
}
93888
func AddFailure(format string, a ...interface{}) {
	r := FailureRecord{
		Error: fmt.Sprintf(format, a...),
	}

	// Get information about the call site.
	var ok bool
	if _, r.FileName, r.LineNumber, ok = runtime.Caller(1); !ok {
		panic("Can't find caller")
	}

	r.FileName = path.Base(r.FileName)

	AddFailureRecord(r)
}
311392
func (p *MemPostings) Add(id uint64, lset labels.Labels) {
	p.mtx.Lock()

	for _, l := range lset {
		p.addFor(id, l)
	}
	p.addFor(id, allPostingsKey)

	p.mtx.Unlock()
}
142195
func (e *Errors) Append(err *Errors) error {
	if err == nil {
		return nil
	}

	e.m.Lock()

	// append Errors at the end of the current list
	e.err = append(e.err, err.err...)

	// set highest priority
	if err.p > e.p {
		e.p = err.p
	}

	e.m.Unlock()
	return nil
}
1374201
func (mp *MultiProvider) Add(dgst digest.Digest, p content.Provider) {
	mp.mu.Lock()
	defer mp.mu.Unlock()
	mp.sub[dgst] = p
}
1069496
func (pc *ProbabilisticCounter) Add(values ...string) {
	for _, value := range values {
		pc.bitset.Set(pc.bitIndex(value))
	}
}
963226
func (e *ControlleeExpectations) Add(add, del int64) {
	atomic.AddInt64(&e.add, add)
	atomic.AddInt64(&e.del, del)
}
1060539
func (pool *Pool) Add(net, addr string, rate int) (err error) {
	pool.mutex.Lock()
	defer pool.mutex.Unlock()
	var item *PoolClient
	var ok bool
	if item, ok = pool.Clients[addr]; ok {
		item.Rate = rate
	} else {
		var client *Client
		client, err = New(net, addr)
		if err == nil {
			item = &PoolClient{Client: client, Rate: rate}
			pool.Clients[addr] = item
		}
	}
	return
}
536889
func (m *errorManager) Add(e ErrorContainer) {
	m.errors = append(m.errors, e)
}
671272
func (r *Report) addFromError(err error, severity entryKind) {
	if err == nil {
		return
	}
	r.Add(Entry{
		Kind:    severity,
		Message: err.Error(),
	})
}
1005974
func (x *Generator) Add(p string) error {
	if x.fsFilesMap == nil {
		x.fsFilesMap = make(map[string]file)
	}

	if x.fsDirsMap == nil {
		x.fsDirsMap = make(map[string][]string)
	}

	p = path.Clean(p)

	info, err := os.Stat(p)

	if err != nil {
		return err
	}

	prefix, p := x.splitRelPrefix(p)

	if err := x.addParents(p, prefix); err != nil {
		return err
	}

	return x.addPath(path.Dir(p), prefix, info)
}
774608
func (p *Parameters) Add(i interface{}) int {
	p.args = append(p.args, i)
	return len(p.args)
}
311836
func (q *RateLimitedTimedQueue) Add(value string, uid interface{}) bool {
	now := now()
	return q.queue.Add(TimedValue{
		Value:     value,
		UID:       uid,
		AddedAt:   now,
		ProcessAt: now,
	})
}
756747
func (c *counters) Add(name string, value int64) {
	a := c.getValueAddr(name)
	atomic.AddInt64(a, value)
}
968459
func (args Args) Add(key, value string) {
	args[key] = append(args[key], value)
}
637532
func (td *MergingDigest) Add(value float64, weight float64) {
	if math.IsNaN(value) || math.IsInf(value, 0) || weight <= 0 {
		panic("invalid value added")
	}

	if len(td.tempCentroids) == cap(td.tempCentroids) {
		td.mergeAllTemps()
	}

	td.min = math.Min(td.min, value)
	td.max = math.Max(td.max, value)
	td.reciprocalSum += (1 / value) * weight

	next := Centroid{
		Mean:   value,
		Weight: weight,
	}
	if td.debug {
		next.Samples = []float64{value}
	}
	td.tempCentroids = append(td.tempCentroids, next)
	td.tempWeight += weight
}