// NewCounters create a new Counters instance. If name is set, all publishes it.
438827
func NewCounters(name string) *Counters {
	c := &Counters{counts: make(map[string]int64)}
	if name != "" {
		Publish(name, c)
	}
	return c
}
1030976
func NewRegisteredCounter(name string, r Registry) Counter {
	c := NewCounter()
	if nil == r {
		r = DefaultRegistry
	}
	r.Register(name, c)
	return c
}
400576
func (mapOp *MapOperation) IncrementCounter(key string, increment int64) *MapOperation {
	if mapOp.removeCounters != nil {
		delete(mapOp.removeCounters, key)
	}
	if mapOp.incrementCounters == nil {
		mapOp.incrementCounters = make(map[string]int64)
	}
	mapOp.incrementCounters[key] += increment
	return mapOp
}
819004
func NewRatioCounter(buckets int, resolution time.Duration, options ...ratioOptSetter) (*RatioCounter, error) {
	rc := &RatioCounter{}

	for _, o := range options {
		if err := o(rc); err != nil {
			return nil, err
		}
	}

	if rc.clock == nil {
		rc.clock = &timetools.RealTime{}
	}

	a, err := NewCounter(buckets, resolution, CounterClock(rc.clock))
	if err != nil {
		return nil, err
	}

	b, err := NewCounter(buckets, resolution, CounterClock(rc.clock))
	if err != nil {
		return nil, err
	}

	rc.a = a
	rc.b = b
	return rc, nil
}
766833
func (s *AutoScaleService) NewListCountersParams() *ListCountersParams {
	p := &ListCountersParams{}
	p.p = make(map[string]interface{})
	return p
}
1050553
func New(now time.Time, duration time.Duration) EventCounter {
	return EventCounter{
		startingTime:     now,
		nsSinceStart:     0,
		eventDuration:    duration,
		eventsThisPeriod: 0,
	}
}
239841
func NewCounterFunc(name string, help string, f func() int64) *CounterFunc {
	c := &CounterFunc{
		F:    f,
		help: help,
	}

	if name != "" {
		publish(name, c)
	}
	return c
}
137480
func NewCounterDurationFunc(name string, help string, f func() time.Duration) *CounterDurationFunc {
	cf := &CounterDurationFunc{
		F:    f,
		help: help,
	}

	if name != "" {
		publish(name, cf)
	}
	return cf
}
765667
func MustRegisterCounter(name string, opts ...descOption) ID {
	return defaultRegistry.MustRegisterCounter(name, opts...)
}
1302105
func (s *LabelingJobForWorkteamSummary) SetLabelCounters(v *LabelCountersForWorkteam) *LabelingJobForWorkteamSummary {
	s.LabelCounters = v
	return s
}
1343142
func (in *Influx) NewCounter(name string) *Counter {
	return &Counter{
		name: name,
		obs:  in.counters.Observe,
	}
}
196583
func NewCounterDuration(name, help string) *CounterDuration {
	cd := &CounterDuration{
		help: help,
	}
	publish(name, cd)
	return cd
}
1231332
func (s *SummarizedAttackVector) SetVectorCounters(v []*SummarizedCounter) *SummarizedAttackVector {
	s.VectorCounters = v
	return s
}
150493
func NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec {
	c := prometheus.NewCounterVec(opts, labelNames)
	prometheus.MustRegister(c)
	return c
}
574071
func NewCounter(Name string, Tags []string) *Counter {
	return &Counter{Name: Name, Tags: Tags}
}
1076091
func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec {
	desc := NewDesc(
		BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
		opts.Help,
		labelNames,
		opts.ConstLabels,
	)
	return &CounterVec{
		metricVec: newMetricVec(desc, func(lvs ...string) Metric {
			if len(lvs) != len(desc.variableLabels) {
				panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs))
			}
			result := &counter{desc: desc, labelPairs: makeLabelPairs(desc, lvs)}
			result.init(result) // Init self-collection.
			return result
		}),
	}
}
1197736
func incCounter(c *[4]byte) {
	if c[3]++; c[3] != 0 {
		return
	}
	if c[2]++; c[2] != 0 {
		return
	}
	if c[1]++; c[1] != 0 {
		return
	}
	c[0]++
}