code: func getMetrics(store *cassandra.CassandraStore, prefix, substr, glob string, archive schema.Archive) ([]Metric, error) {
  	var metrics []Metric
  	iter := store.Session.Query("select id, name from metric_idx").Iter()
  	var m Metric
  	var idString string
  	for iter.Scan(&idString, &m.name) {
  		if match(prefix, substr, glob, m) {
  			mkey, err := schema.MKeyFromString(idString)
  			if err != nil {
  				panic(err)
  			}
  			m.AMKey = schema.AMKey{
  				MKey:    mkey,
  				Archive: archive,
  			}
  			metrics = append(metrics, m)
  		}
  	}
  	err := iter.Close()
  	if err != nil {
  		return metrics, err
  	}
  	sort.Sort(MetricsByName(metrics))
  	return metrics, nil
  }
docs: // getMetrics lists all metrics from the store matching the given condition.