pkg

package
v0.0.0-...-70577aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentEvent

type DeploymentEvent struct {
	ApplicationId      int
	EnvironmentId      int
	ReleaseId          int
	PipelineOverrideId int
	TriggerTime        time.Time
	PipelineMaterials  []*PipelineMaterialInfo
	CiArtifactId       int
}

type DeploymentMetricService

type DeploymentMetricService interface {
	GetDeploymentMetrics(request *MetricRequest) (*Metrics, error)
}

type DeploymentMetricServiceImpl

type DeploymentMetricServiceImpl struct {
	// contains filtered or unexported fields
}

func NewDeploymentMetricServiceImpl

func NewDeploymentMetricServiceImpl(
	logger *zap.SugaredLogger,
	appReleaseRepository sql.AppReleaseRepository,
	pipelineMaterialRepository sql.PipelineMaterialRepository,
	leadTimeRepository sql.LeadTimeRepository) *DeploymentMetricServiceImpl

func (DeploymentMetricServiceImpl) GetDeploymentMetrics

func (impl DeploymentMetricServiceImpl) GetDeploymentMetrics(request *MetricRequest) (*Metrics, error)

type IngestionService

type IngestionService interface {
	ProcessDeploymentEvent(deploymentEvent *DeploymentEvent) (*sql.AppRelease, error)
	CleanAppDataForEnvironment(appId, environmentId int) (bool, error)
}

type IngestionServiceImpl

type IngestionServiceImpl struct {
	PipelineMaterialRepository sql.PipelineMaterialRepository
	// contains filtered or unexported fields
}

func NewIngestionServiceImpl

func NewIngestionServiceImpl(logger *zap.SugaredLogger,
	appReleaseRepository sql.AppReleaseRepository,
	PipelineMaterialRepository sql.PipelineMaterialRepository,
	leadTimeRepository sql.LeadTimeRepository,
	gitSensorRestClient gitSensor.GitSensorClient,
	gitSensorGrpcClient gitSensor.GitSensorGrpcClient) *IngestionServiceImpl

func (*IngestionServiceImpl) CleanAppDataForEnvironment

func (impl *IngestionServiceImpl) CleanAppDataForEnvironment(appId, environmentId int) (bool, error)

func (*IngestionServiceImpl) ProcessDeploymentEvent

func (impl *IngestionServiceImpl) ProcessDeploymentEvent(deploymentEvent *DeploymentEvent) (*sql.AppRelease, error)

1.save AppRelease 2. save PipelineMaterial with release status 4. check for first commit and rollback 5. fetch changes from git 6. save LeadTime and commit size

type Metric

type Metric struct {
	ReleaseType           sql.ReleaseType   `json:"release_type"`
	ReleaseStatus         sql.ReleaseStatus `json:"release_status"`
	ReleaseTime           time.Time         `json:"release_time"`
	ChangeSizeLineAdded   int               `json:"change_size_line_added"`
	ChangeSizeLineDeleted int               `json:"change_size_line_deleted"`
	DeploymentSize        int               `json:"deployment_size"`
	CommitHash            string            `json:"commit_hash"`
	CommitTime            time.Time         `json:"commit_time"`
	LeadTime              float64           `json:"lead_time"`
	CycleTime             float64           `json:"cycle_time"`
	RecoveryTime          float64           `json:"recovery_time"`
}

type MetricRequest

type MetricRequest struct {
	AppId int    `json:"app_id"`
	EnvId int    `json:"env_id"`
	From  string `json:"from"`
	To    string `json:"to"`
}

type Metrics

type Metrics struct {
	Series                 []*Metric `json:"series"`
	AverageCycleTime       float64   `json:"average_cycle_time"`
	AverageLeadTime        float64   `json:"average_lead_time"`
	ChangeFailureRate      float64   `json:"change_failure_rate"`
	AverageRecoveryTime    float64   `json:"average_recovery_time"`
	AverageDeploymentSize  float32   `json:"average_deployment_size"`
	AverageLineAdded       float32   `json:"average_line_added"`
	AverageLineDeleted     float32   `json:"average_line_deleted"`
	LastFailedTime         string    `json:"last_failed_time"`
	RecoveryTimeLastFailed float64   `json:"recovery_time_last_failed"`
}

type PipelineMaterialInfo

type PipelineMaterialInfo struct {
	PipelineMaterialId int
	CommitHash         string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL