// namePartFromDimensions creates a string from a map of dimensions that can
// be used as part of the task name.  The dimensions are first sorted as
// described in mapToArray().
514821
func namePartFromDimensions(m stringmapflag.Value) string {
	a := mapToArray(m)
	pairs := make([]string, 0, len(a))
	for i := 0; i < len(a); i++ {
		pairs = append(pairs, fmt.Sprintf("%s=%s", a[i].Key, a[i].Value))
	}
	return strings.Join(pairs, "_")
}
1126957
func (r *QueryResults) SortedNames() []string {
	names := r.Names()
	sort.Strings(names)
	return names
}
748388
func (d PoolDescriptor) Dimensions() strpair.Map {
	m := strpair.ParseMap(d)
	m.Del(SwarmingHostnameKey)
	return m
}
959464
func (r *Reader) LabelNames() ([]string, error) {
	labelNamesMap := make(map[string]struct{}, len(r.labels))
	for key := range r.labels {
		// 'key' contains the label names concatenated with the
		// delimiter 'labelNameSeperator'.
		names := strings.Split(key, labelNameSeperator)
		for _, name := range names {
			if name == allPostingsKey.Name {
				// This is not from any metric.
				// It is basically an empty label name.
				continue
			}
			labelNamesMap[name] = struct{}{}
		}
	}
	labelNames := make([]string, 0, len(labelNamesMap))
	for name := range labelNamesMap {
		labelNames = append(labelNames, name)
	}
	sort.Strings(labelNames)
	return labelNames, nil
}
184956
func AllSortedNamedFactories() []ErrorFactory {
	sorter := newSorter(namedFactories)
	sort.Sort(sorter)
	return sorter.data
}
1085668
func (s *WriteSegmentRequest) SetDimensions(v *SegmentDimensions) *WriteSegmentRequest {
	s.Dimensions = v
	return s
}
946134
func (cfgSrcHandler *Handler) AddDimensionInfo(dimensionInfo string) (map[string]string, error) {
	if len(cfgSrcHandler.dimensionInfoMap) == 0 {
		cfgSrcHandler.dimensionInfoMap = make(map[string]string)
	}

	for i := range cfgSrcHandler.dimensionInfoMap {
		if i == dimensionInfo {
			openlogging.GetLogger().Errorf("dimension info already exist")
			return cfgSrcHandler.dimensionInfoMap, errors.New("dimension info allready exist")
		}
	}

	cfgSrcHandler.dimensionInfoMap[dimensionInfo] = dimensionInfo

	return cfgSrcHandler.dimensionInfoMap, nil
}
315102
func (mem *memNamedMapping) ListAllNames() (names []string) {
	mem.access.RLock()
	defer mem.access.RUnlock()

	var ret []string

	for name := range mem.nameToIdx {
		ret = append(ret, name)
	}

	return ret
}
620819
func (s *DescribeAlarmsForMetricInput) SetDimensions(v []*Dimension) *DescribeAlarmsForMetricInput {
	s.Dimensions = v
	return s
}
1288417
func (n *NamespaceNamer) ToPublicName(name string) string {
	if n.shortNames {
		if parts := strings.Split(name, "."); len(parts) > 2 {
			name = strings.Join(parts[len(parts)-2:], ".")
		}
	}
	name = n.re.ReplaceAllString(name, " ")
	return strings.Replace(strings.Title(name), " ", "", -1)
}
657882
func (p *IndexFiles) MeasurementNames() [][]byte {
	itr := p.MeasurementIterator()
	if itr == nil {
		return nil
	}

	var names [][]byte
	for e := itr.Next(); e != nil; e = itr.Next() {
		names = append(names, bytesutil.Clone(e.Name()))
	}
	sort.Sort(byteSlices(names))
	return names
}
168317
func (s *HsmConfiguration) SetHsmPartitionName(v string) *HsmConfiguration {
	s.HsmPartitionName = &v
	return s
}
608826
func (s *Scheduler) GroupedDefaultDimensions(group string, dims map[string]string) {
	s.callbackMutex.Lock()
	defer s.callbackMutex.Unlock()
	subgroup, exists := s.callbackMap[group]
	if !exists {
		subgroup = &callbackPair{
			callbacks:         make(map[Collector]struct{}, 0),
			defaultDimensions: dims,
		}
		s.callbackMap[group] = subgroup
	}
	subgroup.defaultDimensions = dims
}
970347
func DefaultDimensions(conf *ClientConfig) (map[string]string, error) {
	signalfuseSourceName := conf.SourceName.Get()
	if signalfuseSourceName != "" {
		return map[string]string{"sf_source": signalfuseSourceName}, nil
	}
	hostname, err := conf.OsHostname()
	if err != nil {
		return nil, errors.Annotate(err, "unable to get hostname for default source")
	}
	return map[string]string{"sf_source": hostname}, nil
}
505653
func (s *CreateHsmConfigurationInput) SetHsmPartitionName(v string) *CreateHsmConfigurationInput {
	s.HsmPartitionName = &v
	return s
}
999323
func (s MeasurementStats) MeasurementNames() []string {
	a := make([]string, 0, len(s))
	for name := range s {
		a = append(a, name)
	}
	sort.Strings(a)
	return a
}
489980
func (s *PutMetricAlarmInput) SetDimensions(v []*Dimension) *PutMetricAlarmInput {
	s.Dimensions = v
	return s
}