// Percentiles returns a slice of arbitrary percentiles of values at the time
// the snapshot was taken.
518154
func (s *SampleSnapshot) Percentiles(ps []float64) []float64 {
	return SamplePercentiles(s.values, ps)
}
589188
func (sint *SliceInt) BuildStats() (SliceIntStats, error) {
	stats := NewSliceIntStats()
	stats.Len = sint.Len()
	max, err := sint.Max()
	if err != nil {
		return stats, err
	}
	stats.Max = max
	min, err := sint.Min()
	if err != nil {
		return stats, err
	}
	stats.Min = min
	mean, err := sint.Mean()
	if err != nil {
		return stats, err
	}
	stats.Mean = mean
	median, err := sint.Median()
	if err != nil {
		return stats, err
	}
	stats.Median = median
	sum, err := sint.Sum()
	if err != nil {
		return stats, err
	}
	stats.Sum = sum
	sint.Stats = stats
	return stats, nil
}
809844
func (s *UniformSample) Percentiles(ps []float64) []float64 {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	return SamplePercentiles(s.values, ps)
}
888244
func (p *PercentilesBucketAggregation) Format(format string) *PercentilesBucketAggregation {
	p.format = format
	return p
}
111895
func (t *Timings) Histograms() (h map[string]*Histogram) {
	t.mu.Lock()
	defer t.mu.Unlock()
	h = make(map[string]*Histogram, len(t.histograms))
	for k, v := range t.histograms {
		h[k] = v
	}
	return
}
1012549
func (h *HistogramSnapshot) Percentile(p float64) float64 {
	return h.sample.Percentile(p)
}
1251979
func (c *cluster) containsShards(index string, availableShards *roaring.Bitmap, node *Node) []uint64 {
	var shards []uint64
	availableShards.ForEach(func(i uint64) {
		p := c.partition(index, i)
		// Determine the nodes for partition.
		nodes := c.partitionNodes(p)
		for _, n := range nodes {
			if n.ID == node.ID {
				shards = append(shards, i)
			}
		}
	})
	return shards
}
1100661
func UsePercentiles(percentiles []float64) ReporterOption {
	return func(r *Reporter) error {
		if len(percentiles) == 0 {
			return fmt.Errorf("Must specify at least 1 percentile")
		}
		var err error
		r.percentiles = percentiles
		r.p, err = getPercentileNames(percentiles)
		return err
	}
}
849502
func (r *TestResults) calcTotals() {
	totalTime, _ := strconv.ParseFloat(r.Time, 64)
	for _, suite := range r.Suites {
		r.NumPassed += suite.NumPassed()
		r.NumFailed += suite.NumFailed()
		r.NumSkipped += suite.NumSkipped()

		suiteTime, _ := strconv.ParseFloat(suite.Time, 64)
		totalTime += suiteTime
		r.Time = fmt.Sprintf("%.3f", totalTime)
	}
	r.Len = r.NumPassed + r.NumSkipped + r.NumFailed
}
380394
func PercentilInt(data []int, p int) int {
	n := len(data)
	if n == 0 {
		return 0
	}
	if n == 1 {
		return data[0]
	}

	pos := float64(p) * float64(n+1) / 100
	fpos := math.Floor(pos)
	intPos := int(fpos)
	dif := pos - fpos
	if intPos < 1 {
		return data[0]
	}
	if intPos >= n {
		return data[n-1]
	}
	lower := data[intPos-1]
	upper := data[intPos]
	val := float64(lower) + dif*float64(upper-lower)
	return int(math.Floor(val + 0.5))
}
137901
func LogLabels(labels ...string) {
	content := "time\t"
	for _, percentile := range percentiles {
		content += fmt.Sprintf("%%%02d\t", int(percentile*100))
	}
	content += strings.Join(labels, "\t")
	fmt.Println(content)
}
283970
func PercentValue(value, sum float64) (s string) {
	value *= 100 / sum
	s = AbsoluteValue(value, sum) + "% "
	return
}
359683
func (p *PercentilesBucketAggregation) Percents(percents ...float64) *PercentilesBucketAggregation {
	p.percents = percents
	return p
}
1054935
func (s *DescribeSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeSnapshotsOutput {
	s.Snapshots = v
	return s
}
1084011
func (m *nativeGitClient) LsFiles(path string) ([]string, error) {
	out, err := m.runCmd("git", "ls-files", "--full-name", "-z", "--", path)
	if err != nil {
		return nil, err
	}
	// remove last element, which is blank regardless of whether we're using nullbyte or newline
	ss := strings.Split(out, "\000")
	return ss[:len(ss)-1], nil
}
91901
func (c *ChainIndexer) Sections() (uint64, uint64, common.Hash) {
	c.lock.Lock()
	defer c.lock.Unlock()

	return c.storedSections, c.storedSections*c.sectionSize - 1, c.SectionHead(c.storedSections - 1)
}
859175
func (s *Bitset) Bits() []uint {
	res := make([]uint, s.BitCount())
	index := 0
	for i, l := Uint0, s.length; i < l; i++ {
		if s.IsSet(i) {
			res[index] = i
			index++
		}
	}

	return res
}