code: func (r *runtimeVM) ContainerStats(c *Container) (*ContainerStats, error) {
  	logrus.Debug("runtimeVM.ContainerStats() start")
  	defer logrus.Debug("runtimeVM.ContainerStats() end")
  
  	// Lock the container with a shared lock
  	c.opLock.RLock()
  	defer c.opLock.RUnlock()
  
  	resp, err := r.task.Stats(r.ctx, &task.StatsRequest{
  		ID: c.ID(),
  	})
  	if err != nil {
  		return nil, errdefs.FromGRPC(err)
  	}
  	if resp == nil {
  		return nil, errors.New("Could not retrieve container stats")
  	}
  
  	stats, err := typeurl.UnmarshalAny(resp.Stats)
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to extract container metrics")
  	}
  
  	metrics, ok := stats.(*cgroups.Metrics)
  	if !ok {
  		return nil, errors.Errorf("Unknown stats type %T", stats)
  	}
  
  	return metricsToCtrStats(c, metrics), nil
  }
docs: // ContainerStats provides statistics of a container.