// Add adds a single Stopwatch name with the given name.
348746
func (ns *NamedStopwatch) Add(name string) error {
	ns.Lock()
	defer ns.Unlock()

	return ns.add(name)
}
514048
func (w *Watcher) addWatch(path string, flags uint32) error {
	if w.isClosed {
		return errors.New("inotify instance already closed")
	}

	w.mu.Lock()
	watchEntry, found := w.watches[path]
	w.mu.Unlock()
	if found {
		watchEntry.flags |= flags
		flags |= syscall.IN_MASK_ADD
	}
	wd, errno := syscall.InotifyAddWatch(w.fd, path, flags)
	if wd == -1 {
		return errno
	}

	w.mu.Lock()
	w.watches[path] = &watch{wd: uint32(wd), flags: flags}
	w.paths[wd] = path
	w.mu.Unlock()

	return nil
}
486016
func (a *AnnotationStore) Add(ctx context.Context, anno *chronograf.Annotation) (*chronograf.Annotation, error) {
	var err error
	anno.ID, err = a.id.Generate()
	if err != nil {
		return nil, err
	}
	return anno, a.client.Write(ctx, []chronograf.Point{
		toPoint(anno, a.now()),
	})
}
1285480
func (twg *TimeoutWaitGroup) Add(delta int) {
	twg.mutex.Lock()
	defer twg.mutex.Unlock()
	if twg.workers == 0 {
		// waitgroups are reusable once workers is 0
		twg.last = nil
	} else if twg.workers > 0 && twg.last != nil {
		// This mimics normal WG behavior. Cannot add after Wait() has been
		// called, unless workers is 0.  Prevents races on Wait()
		panic("TimeoutWaitGroup misuse: Add called concurrently with Wait")
	}
	twg.workers += delta
}
765456
func (idm *IdentityManager) Add(identity *identity.Identity) {
	idm.mutex.Lock()
	defer idm.mutex.Unlock()
	idm.add(identity)
}
707872
func AddDimension(name, value string) {
	Dimensions = append(Dimensions, cloudwatch.Dimension{Name: name, Value: value})
}
1068161
func (c *stringChanger) Add(v string) error {
	if c.err != nil {
		return c.err
	}
	_, err := c.node.addChild(justValue{v})
	return err
}
1168770
func (t *TimeCounter) Add(dur time.Duration) {
	if dur.Nanoseconds() <= atomic.LoadInt64(&t.NsBarrier) {
		atomic.AddInt64(&t.Below, 1)
		return
	}
	atomic.AddInt64(&t.Above, 1)
}
315254
func (met *Metrics) Add(name string, value int64) {
	atomic.AddInt64(met.get(name), value)
}
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
}
679987
func (sm *ScriptMap) Add(scriptName string, script *Script) {
	sm.lock.Lock()
	defer sm.lock.Unlock()
	sm.scripts[scriptName] = script
}
462034
func (set IdentifierSet) Add(i Identifier) bool {
	_, found := set[i]
	set[i] = struct{}{}
	return !found //False if it existed already
}
609654
func (f *RequestArgs) Add(name string, value interface{}) {
	f.params[name] = value
}
979042
func (ns *Namespace) Add(a, b interface{}) (interface{}, error) {
	return _math.DoArithmetic(a, b, '+')
}
499575
func (trb *RingBuffer) Add(title string, body []byte) {
	if len(trb.msgs) <= 0 {
		return
	}

	msg := &Msg{
		Title:   title,
		Body:    body,
		Repeats: 1,
	}

	trb.m.Lock()

	if trb.consolidateFunc != nil {
		msg = trb.consolidateFunc(msg, trb.lastUNLOCKED())
		if msg == nil {
			trb.m.Unlock()

			return
		}
	}

	trb.msgs[trb.next] = *msg

	trb.next++
	if trb.next >= len(trb.msgs) {
		trb.next = 0
	}

	trb.m.Unlock()
}
95901
func (cli *OpsGenieHeartbeatClient) Add(req heartbeat.AddHeartbeatRequest) (*heartbeat.AddHeartbeatResponse, error) {
	var response heartbeat.HeartbeatResponseV2

	err := cli.sendPostRequest(&req, &response)

	if err != nil {
		return nil, err;
	}
	result := convertAddResponseToV1Response(&response)
	result.Code = 201
	return result, nil
}
99063
func (f *FakeWatcher) Add(obj runtime.Object) {
	f.result <- Event{Added, obj}
}