// NewGauge implements Provider.
776160
func (p *graphiteProvider) NewGauge(name string) metrics.Gauge {
	return p.g.NewGauge(name)
}
811203
func NewGaugesWithSingleLabel(name, help, label string, tags ...string) *GaugesWithSingleLabel {
	g := &GaugesWithSingleLabel{
		CountersWithSingleLabel: CountersWithSingleLabel{
			counters: counters{
				counts: make(map[string]*int64),
				help:   help,
			},
			label: label,
		},
	}

	for _, tag := range tags {
		g.counts[tag] = new(int64)
	}
	if name != "" {
		publish(name, g)
	}
	return g
}
677336
func NewProvider(calculateHints bool) Provider {
	return &Store{
		calculateHints: calculateHints,
		metrics:        make(map[string][]time.Duration),
		diffs:          make(map[string]*diff),
	}
}
96706
func NewGaugeDurationFunc(name string, help string, f func() time.Duration) *GaugeDurationFunc {
	gf := &GaugeDurationFunc{
		CounterDurationFunc: CounterDurationFunc{
			F:    f,
			help: help,
		},
	}

	if name != "" {
		publish(name, gf)
	}
	return gf
}
316910
func (in *Influx) NewGauge(name string) *Gauge {
	return &Gauge{
		name: name,
		obs:  in.gauges.Observe,
		add:  in.gauges.Add,
	}
}
886324
func (p *dogstatsdProvider) NewGauge(name string) metrics.Gauge {
	return p.d.NewGauge(name)
}
1117197
func NewProviderAggregator(conf static.Providers) ProviderAggregator {
	p := ProviderAggregator{}

	if conf.File != nil {
		p.quietAddProvider(conf.File)
	}

	if conf.Docker != nil {
		p.quietAddProvider(conf.Docker)
	}

	if conf.Marathon != nil {
		p.quietAddProvider(conf.Marathon)
	}

	if conf.Rest != nil {
		p.quietAddProvider(conf.Rest)
	}

	if conf.Kubernetes != nil {
		p.quietAddProvider(conf.Kubernetes)
	}

	if conf.KubernetesCRD != nil {
		p.quietAddProvider(conf.KubernetesCRD)
	}
	if conf.Rancher != nil {
		p.quietAddProvider(conf.Rancher)
	}

	return p
}
610960
func New() *Provider {
	return &Provider{
		params: &scryptParams{
			keyLen:  DefaultKeyLen,
			n:       DefaultN,
			r:       DefaultR,
			p:       DefaultP,
			saltLen: DefaultSaltLen,
		},
	}
}
963808
func (g *Graphite) NewGauge(name string) *Gauge {
	ga := NewGauge(g.prefix + name)
	g.mtx.Lock()
	g.gauges[g.prefix+name] = ga
	g.mtx.Unlock()
	return ga
}
1201578
func AddIntGauge(name string, tgs Tags) uint32 {
	id := atomic.AddUint32(curIntGaugeID, 1) - 1

	if id >= maxNumGauges {
		panic("Too many int gauges")
	}

	intgnames[id] = name

	tgs = copyTags(tgs)
	tgs[TagMetricType] = MetricTypeGauge
	tgs[TagDataType] = DataTypeUint64
	intgtags[id] = tgs

	return id
}
1212726
func (p *provider) NewConfig() (*osincli.ClientConfig, error) {
	config := &osincli.ClientConfig{
		ClientId:                 p.clientID,
		ClientSecret:             p.clientSecret,
		ErrorsInStatusCode:       true,
		SendClientSecretInParams: true,
		AuthorizeUrl:             p.authorizeURL,
		TokenUrl:                 p.tokenURL,
		Scope:                    gitlabOAuthScope,
	}
	return config, nil
}
1220283
func NewProvider(constructor interface{}, argPtrs ...interface{}) Provider {
	fnValue := reflect.ValueOf(constructor)
	if fnValue.Kind() != reflect.Func {
		panic(fmt.Sprintf("constructor (%v) is not a function, found %v", fnValue, fnValue.Kind()))
	}

	fnType := reflect.TypeOf(constructor)
	if fnType.NumOut() != 1 {
		panic(fmt.Sprintf("constructor must have exactly 1 return value, found %v", fnType.NumOut()))
	}

	argCount := fnType.NumIn()
	if !fnValue.Type().IsVariadic() && argCount != len(argPtrs) {
		panic(fmt.Sprintf("argPtrs (%d) must match constructor arguments (%d)", len(argPtrs), argCount))
	}

	var kind reflect.Kind
	for i, argPtr := range argPtrs {
		isVariadic := fnValue.Type().IsVariadic() && (fnType.NumIn() == 1 || i >= fnType.NumIn())

		if i < fnType.NumIn() {
			kind = fnType.In(i).Kind()
		} else {
			kind = fnType.In(fnType.NumIn() - 1).Kind()
		}

		if reflect.TypeOf(argPtr).Kind() != reflect.Ptr {
			panic(fmt.Sprintf("argPtrs must all be pointers, found %v", reflect.TypeOf(argPtr)))
		}

		if !isVariadic && reflect.ValueOf(argPtr).Elem().Kind() != kind {
			panic("argPtrs must match constructor argument types")
		}
	}

	return provider{
		constructor: constructor,
		argPtrs:     argPtrs,
	}
}
1175107
func (l *Logger) New(ctx *gear.Context) (interface{}, error) {
	log := Log{}
	l.init(log, ctx)
	return log, nil
}
1287199
func New(notFound http.Handler, p Provider) (*Swagui, error) {
	efmt := "new swagui: %s"

	if notFound == nil {
		notFound = http.NotFoundHandler()
	}
	if p == nil {
		return nil, fmt.Errorf(efmt, "provider must be set")
	}

	s := Swagui{
		nf: notFound,
		p:  p,
	}

	return &s, nil
}
548271
func NewGauge(name string, help string) *Gauge {
	v := &Gauge{Counter: Counter{help: help}}

	if name != "" {
		publish(name, v)
	}
	return v
}
665763
func New(cfg interface{}, gadgets ...Gadgeter) *App {
	config := GetConfig(cfg)
	return &App{
		gadgets: config.CreateGadgets(gadgets...),
	}
}
981833
func NewGaugeFunc(name string, help string, f func() int64) *GaugeFunc {
	i := &GaugeFunc{
		CounterFunc: CounterFunc{
			F:    f,
			help: help,
		}}

	if name != "" {
		publish(name, i)
	}
	return i
}