func (self *MemStore) getKey(sc *net.SeriesCommand) string { key := sc.Entity() metrics := []string{} for metricName := range sc.Metrics() { metrics = append(metrics, metricName) } sort.Strings(metrics) for i := range metrics { key += metrics[i] } tags := []string{} for tagName, tagValue := range sc.Tags() { tags = append(tags, tagName+"="+tagValue) } sort.Strings(tags) for i := range tags { key += tags[i] } return key }