// Distribution tracks the statistical distribution of a set of values across your infrastructure.
545205
func (c *Client) Distribution(name string, value float64, tags []string, rate float64) error {
	return c.send(name, value, distributionSuffix, tags, rate)
}
164338
func (srv *Instance) Stats() agents.ServerStats {
	return agents.ServerStats{
		Total:      srv.getPromCtrValue(totalCtr),
		Valid:      srv.getPromCtrValue(validatedCtr),
		Invalid:    srv.getPromCtrValue(unvalidatedCtr),
		Passed:     srv.getPromCtrValue(passedCtr),
		Filtered:   srv.getPromCtrValue(filteredCtr),
		Replies:    srv.getPromCtrValue(repliesCtr),
		TTLExpired: srv.getPromCtrValue(ttlExpiredCtr),
	}
}
1273417
func (_m *APIClient) DistributionInspect(ctx context.Context, _a1 string, encodedRegistryAuth string) (registry.DistributionInspect, error) {
	ret := _m.Called(ctx, _a1, encodedRegistryAuth)

	var r0 registry.DistributionInspect
	if rf, ok := ret.Get(0).(func(context.Context, string, string) registry.DistributionInspect); ok {
		r0 = rf(ctx, _a1, encodedRegistryAuth)
	} else {
		r0 = ret.Get(0).(registry.DistributionInspect)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
		r1 = rf(ctx, _a1, encodedRegistryAuth)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
252705
func (e Total) Stats() []string {
	return []string{fmt.Sprintf("%s:%d|t", e.Name, e.Value)}
}
499718
func (c *Distconf) Var() expvar.Var {
	return expvar.Func(func() interface{} {
		c.varsMutex.Lock()
		defer c.varsMutex.Unlock()

		m := make(map[string]interface{}, len(c.registeredVars))
		for name, v := range c.registeredVars {
			m[name] = v.distvar.GenericGet()
		}
		return m
	})
}
899679
func (a *Allocations) Stats(args *cstructs.AllocStatsRequest, reply *cstructs.AllocStatsResponse) error {
	defer metrics.MeasureSince([]string{"client", "allocations", "stats"}, time.Now())

	// Check read job permissions
	if aclObj, err := a.c.ResolveToken(args.AuthToken); err != nil {
		return err
	} else if aclObj != nil && !aclObj.AllowNsOp(args.Namespace, acl.NamespaceCapabilityReadJob) {
		return nstructs.ErrPermissionDenied
	}

	clientStats := a.c.StatsReporter()
	aStats, err := clientStats.GetAllocStats(args.AllocID)
	if err != nil {
		return err
	}

	stats, err := aStats.LatestAllocStats(args.Task)
	if err != nil {
		return err
	}

	reply.Stats = stats
	return nil
}
1276619
func (r *Route) Stats() tcpip.Stats {
	return r.ref.nic.stack.Stats()
}
9508
func Distribute(rs Publisher, ms ...Sender) Publisher {
	return rs.React(func(r Publisher, err error, data interface{}) {
		for _, mi := range ms {
			go func(rec Sender) {
				if err != nil {
					rec.SendError(err)
					return
				}
				rec.Send(data)
			}(mi)
		}
	}, true)
}
133316
func (p *Plan) Stats() PlanStats {
	var ret PlanStats
	for _, r := range p.Resources {
		switch r.Action {
		case plans.Create:
			ret.ToAdd++
		case plans.Update:
			ret.ToChange++
		case plans.DeleteThenCreate, plans.CreateThenDelete:
			ret.ToAdd++
			ret.ToDestroy++
		case plans.Delete:
			ret.ToDestroy++
		}
	}
	return ret
}
875817
func Dist(product string) (string, error) {
	godelw, err := newGodelwRunner()
	if err != nil {
		return "", err
	}
	if _, err := godelw.run("dist", product); err != nil {
		return "", err
	}
	return godelw.run("artifacts", "dist", "--absolute", product)
}
1213332
func (m *Broadcaster) distribute(event Event) {
	m.lock.Lock()
	defer m.lock.Unlock()
	if m.fullChannelBehavior == DropIfChannelFull {
		for _, w := range m.watchers {
			select {
			case w.result <- event:
			case <-w.stopped:
			default: // Don't block if the event can't be queued.
			}
		}
	} else {
		for _, w := range m.watchers {
			select {
			case w.result <- event:
			case <-w.stopped:
			}
		}
	}
}
1276045
func (p ProviderAggregator) Provide(configurationChan chan<- config.Message, pool *safe.Pool) error {
	if p.fileProvider != nil {
		launchProvider(configurationChan, pool, p.fileProvider)
	}

	for _, prd := range p.providers {
		prd := prd
		safe.Go(func() {
			launchProvider(configurationChan, pool, prd)
		})
	}
	return nil
}
467803
func (e Gauge) Stats() []string {
	if e.Value < 0 {
		// because a leading '+' or '-' in the value of a gauge denotes a delta, to send
		// a negative gauge value we first set the gauge absolutely to 0, then send the
		// negative value as a delta from 0 (that's just how the spec works :-)
		return []string{
			fmt.Sprintf("%s:%d|g", e.Name, 0),
			fmt.Sprintf("%s:%d|g", e.Name, e.Value),
		}
	}
	return []string{fmt.Sprintf("%s:%d|g", e.Name, e.Value)}
}
135698
func Dist(hash, i, capacity int64) int64 {
	mask := capacity - 1
	dist := (i + capacity - (hash & mask)) & mask
	return dist
}
1259515
func (p *ConnPool) Stat() (s ConnPoolStat) {
	p.cond.L.Lock()
	defer p.cond.L.Unlock()

	s.MaxConnections = p.maxConnections
	s.CurrentConnections = len(p.allConnections)
	s.AvailableConnections = len(p.availableConnections)
	return
}
915829
func (s *TrackingConn) Stat() (uint64, uint64) {
	return atomic.LoadUint64(&s.txBytes), atomic.LoadUint64(&s.rxBytes)
}
186216
func (c *Client) Stats(key string) ([]StatValue, error) {
	rv := make([]StatValue, 0, 128)

	req := &gomemcached.MCRequest{
		Opcode: gomemcached.STAT,
		Key:    []byte(key),
		Opaque: 918494,
	}

	_, err := transmitRequest(c.conn, req)
	if err != nil {
		return rv, err
	}

	for {
		res, _, err := getResponse(c.conn, c.hdrBuf)
		if err != nil {
			return rv, err
		}
		k := string(res.Key)
		if k == "" {
			break
		}
		rv = append(rv, StatValue{
			Key: k,
			Val: string(res.Body),
		})
	}

	return rv, nil
}