code: func (kc *kubeClient) GetDeploymentStats(spaceName string, appName string, envName string,
  	startTime time.Time) (*app.SimpleDeploymentStats, error) {
  	envNS, err := kc.getDeployableEnvironmentNamespace(envName)
  	if err != nil {
  		return nil, err
  	}
  	// Get the UID for the current deployment of the app
  	deploy, err := kc.getCurrentDeployment(spaceName, appName, envNS)
  	if err != nil {
  		return nil, err
  	} else if deploy == nil || deploy.current == nil {
  		return nil, nil
  	}
  
  	// Get pods belonging to current deployment
  	pods, err := kc.getPods(envNS, deploy.current)
  	if err != nil {
  		return nil, err
  	}
  
  	mc, err := kc.GetMetricsClient(envNS)
  	if err != nil {
  		return nil, err
  	}
  
  	// Gather the statistics we need about the current deployment
  	cpuUsage, err := mc.GetCPUMetrics(pods, envNS, startTime)
  	if err != nil {
  		return nil, err
  	}
  	memoryUsage, err := mc.GetMemoryMetrics(pods, envNS, startTime)
  	if err != nil {
  		return nil, err
  	}
  	netTxUsage, err := mc.GetNetworkSentMetrics(pods, envNS, startTime)
  	if err != nil {
  		return nil, err
  	}
  	netRxUsage, err := mc.GetNetworkRecvMetrics(pods, envNS, startTime)
  	if err != nil {
  		return nil, err
  	}
  
  	result := &app.SimpleDeploymentStats{
  		Type: "deploymentstats",
  		Attributes: &app.SimpleDeploymentStatsAttributes{
  			Cores:  cpuUsage,
  			Memory: memoryUsage,
  			NetTx:  netTxUsage,
  			NetRx:  netRxUsage,
  		},
  	}
  
  	return result, nil
  }
docs: // GetDeploymentStats returns performance metrics of an application for a period of 1 minute
  // beyond the specified start time, which are then aggregated into a single data point.