code: func (r *EtcdRegistry) statesByMUSKey() (map[MUSKey]*unit.UnitState, error) {
  	mus := make(map[MUSKey]*unit.UnitState)
  	key := r.prefixed(statesPrefix)
  	opts := &etcd.GetOptions{
  		Recursive: true,
  	}
  	res, err := r.kAPI.Get(context.Background(), key, opts)
  	if err != nil && !isEtcdError(err, etcd.ErrorCodeKeyNotFound) {
  		return nil, err
  	}
  	if res != nil {
  		for _, dir := range res.Node.Nodes {
  			_, name := path.Split(dir.Key)
  			for _, node := range dir.Nodes {
  				_, machID := path.Split(node.Key)
  				var usm unitStateModel
  				if err := unmarshal(node.Value, &usm); err != nil {
  					log.Errorf("Error unmarshalling UnitState(%s) from Machine(%s): %v", name, machID, err)
  					continue
  				}
  				us := modelToUnitState(&usm, name)
  				if us != nil {
  					key := MUSKey{name, machID}
  					mus[key] = us
  				}
  			}
  		}
  	}
  	return mus, nil
  }
docs: // statesByMUSKey returns a map of all UnitStates stored in the registry indexed by MUSKey