code: func (c *DeploymentsController) ShowDeploymentStats(ctx *app.ShowDeploymentStatsDeploymentsContext) error {
  
  	kc, err := c.GetKubeClient(ctx)
  	defer cleanup(kc)
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  
  	kubeSpaceName, err := c.getSpaceNameFromSpaceID(ctx, ctx.SpaceID)
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, errors.NewNotFoundError("osio space", ctx.SpaceID.String()))
  	}
  
  	var startTime time.Time
  	if ctx.Start != nil {
  		startTime = convertToTime(int64(*ctx.Start))
  	} else {
  		// If a start time was not supplied, default to one minute ago
  		startTime = time.Now().Add(-1 * time.Minute)
  	}
  
  	deploymentStats, err := kc.GetDeploymentStats(*kubeSpaceName, ctx.AppName, ctx.DeployName, startTime)
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, errs.Wrapf(err,
  			"could not retrieve deployment statistics for deployment '%s' in space '%s'", ctx.DeployName, *kubeSpaceName))
  	}
  	if deploymentStats == nil {
  		return jsonapi.JSONErrorResponse(ctx, errors.NewNotFoundError("deployment", ctx.DeployName))
  	}
  
  	deploymentStats.ID = ctx.DeployName
  
  	res := &app.SimpleDeploymentStatsSingle{
  		Data: deploymentStats,
  	}
  
  	return ctx.OK(res)
  }
docs: // ShowDeploymentStats runs the showDeploymentStats action.