code: func (m *Manager) AvailableMetric(ctx context.Context, entity types.ManagedObjectReference, interval int32) (MetricList, error) {
  	req := types.QueryAvailablePerfMetric{
  		This:       m.Reference(),
  		Entity:     entity.Reference(),
  		IntervalId: interval,
  	}
  
  	res, err := methods.QueryAvailablePerfMetric(ctx, m.Client(), &req)
  	if err != nil {
  		return nil, err
  	}
  
  	if m.Sort {
  		info, err := m.CounterInfoByKey(ctx)
  		if err != nil {
  			return nil, err
  		}
  
  		sort.Sort(groupPerfCounterInfo{info, res.Returnval})
  	}
  
  	return MetricList(res.Returnval), nil
  }
docs: // AvailableMetric wraps the QueryAvailablePerfMetric method.
  // The MetricList is sorted by PerfCounterInfo.GroupInfo.Key if Manager.Sort == true.