code: func (c *DeploymentsController) ShowDeploymentStatSeries(ctx *app.ShowDeploymentStatSeriesDeploymentsContext) error {
  
  	endTime := time.Now()
  	startTime := endTime.Add(-8 * time.Hour) // default: start time is 8 hours before end time
  	limit := -1                              // default: No limit
  
  	if ctx.Limit != nil {
  		limit = *ctx.Limit
  	}
  
  	if ctx.Start != nil {
  		startTime = convertToTime(int64(*ctx.Start))
  	}
  
  	if ctx.End != nil {
  		endTime = convertToTime(int64(*ctx.End))
  	}
  
  	if endTime.Before(startTime) {
  		return jsonapi.JSONErrorResponse(ctx, errors.NewBadParameterError("end", *ctx.End))
  	}
  
  	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, err)
  	}
  
  	statSeries, err := kc.GetDeploymentStatSeries(*kubeSpaceName, ctx.AppName, ctx.DeployName,
  		startTime, endTime, limit)
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	} else if statSeries == nil {
  		return jsonapi.JSONErrorResponse(ctx, errors.NewNotFoundError("deployment", ctx.DeployName))
  	}
  
  	res := &app.SimpleDeploymentStatSeriesSingle{
  		Data: statSeries,
  	}
  
  	return ctx.OK(res)
  }
docs: // ShowDeploymentStatSeries runs the showDeploymentStatSeries action.