Documentation ¶
Index ¶
- func CreateStatDashboardConfig(args *StatDashboardConfig, logger *zap.SugaredLogger) error
- func DeleteStatDashboardConfig(id string, logger *zap.SugaredLogger) error
- func GetAllPipelineTask(log *zap.SugaredLogger) error
- func GetBuildDailyAverageMeasure(startDate int64, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*dailyBuildStat, error)
- func GetBuildDailyMeasure(startDate int64, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*buildStatDaily, error)
- func GetBuildHealthMeasure(startDate int64, endDate int64, productNames []string, log *zap.SugaredLogger) (*buildStatTotal, error)
- func GetBuildStatByProdutName(productName string, startTimestamp int64, log *zap.SugaredLogger) ([]*models.BuildStat, error)
- func GetBuildStats(args *models.BuildStatOption, log *zap.SugaredLogger) (*dashboardBuild, error)
- func GetBuildTotalAndSuccess(args *models.BuildStatOption, log *zap.SugaredLogger) (*dashboardBuild, error)
- func GetBuildTrendMeasure(startDate int64, endDate int64, productNames []string, log *zap.SugaredLogger) (*buildTrend, error)
- func GetDeployDailyTotalAndSuccess(args *models.DeployStatOption, log *zap.SugaredLogger) (*dashboardDeploy, error)
- func GetDeployHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*deployStatTotal, error)
- func GetDeployStatByProdutName(productName string, startTimestamp int64, log *zap.SugaredLogger) ([]*models.DeployStat, error)
- func GetDeployStats(args *models.DeployStatOption, log *zap.SugaredLogger) (*dashboardDeploy, error)
- func GetDeployTopFiveFailureMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployFailureHigherStat, error)
- func GetDeployTopFiveHigherMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployHigherStat, error)
- func GetDeployWeeklyMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployStatWeekly, error)
- func GetLatestTenBuildMeasure(productNames []string, log *zap.SugaredLogger) ([]*buildStatLatestTen, error)
- func GetPipelineHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*deployStatTotal, error)
- func GetRequirementDeliveryLeadTime(startTime, endTime int64, project string) (float64, error)
- func GetRequirementDevelopmentLeadTime(startTime, endTime int64, project string) (float64, error)
- func GetTenDurationMeasure(startDate int64, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*buildStatLatestTen, error)
- func GetTestAverageMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testStatDailyArg, error)
- func GetTestCaseMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testCaseStat, error)
- func GetTestDashboard(startTime, endTime int64, productName string, log *zap.SugaredLogger) (*testDashboard, error)
- func GetTestDeliveryDeployMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testDeployStat, error)
- func GetTestHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*testStatTotal, error)
- func GetTestStatByProdutName(productName string, startTimestamp int64, log *zap.SugaredLogger) ([]*models.TestStat, error)
- func GetTestTrendMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*testTrend, error)
- func InitDeployStat(log *zap.SugaredLogger) error
- func InitTestStat(log *zap.SugaredLogger) error
- func UpdateStatDashboardConfig(id string, args *StatDashboardConfig, logger *zap.SugaredLogger) error
- type APIConfig
- type BuildAverageDurationCalculator
- type BuildFrequencyCalculator
- type BuildStat
- type BuildStatTotal
- type BuildSuccessRateCalculator
- type CurrentDay
- type Currently30DayBuildTrend
- type DailyBuildStat
- type DailyJobInfo
- type DailyStat
- type DailyTestStat
- type DeployAverageDurationCalculator
- type DeployFrequencyCalculator
- type DeployStat
- type DeployStatTotal
- type DeploySuccessRateCalculator
- type DevDelPeriod
- type EfficiencyRadarData
- type GeneralCalculator
- type MonthAttention
- type MonthAttentionData
- type OpenAPIStatV2
- type Overview
- type ProjectDailyBuildStat
- type ProjectsBuildStatTotal
- type ProjectsDailyTestStat
- type ProjectsDeployStatTotal
- type ProjectsTestStatTotal
- type ProjectsWeeklyDeployStat
- type ProjectsWeeklyTestStat
- type ReleaseAverageDurationCalculator
- type ReleaseFrequencyCalculator
- type ReleaseStat
- type ReleaseSuccessRateCalculator
- type StatCalculator
- type StatDashboardBasicData
- type StatDashboardByProject
- type StatDashboardConfig
- type StatDashboardItem
- type TaskPreview
- type TestAverageDurationCalculator
- type TestPassRateCalculator
- type TestStat
- type TestStatTotal
- type WeeklyBuildStat
- type WeeklyDeployStat
- type WeeklyStat
- type WeeklyTestStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStatDashboardConfig ¶ added in v1.9.9
func CreateStatDashboardConfig(args *StatDashboardConfig, logger *zap.SugaredLogger) error
func DeleteStatDashboardConfig ¶ added in v1.9.9
func DeleteStatDashboardConfig(id string, logger *zap.SugaredLogger) error
func GetAllPipelineTask ¶
func GetAllPipelineTask(log *zap.SugaredLogger) error
func GetBuildDailyMeasure ¶
func GetBuildHealthMeasure ¶
func GetBuildStatByProdutName ¶ added in v1.9.9
func GetBuildStats ¶ added in v1.9.9
func GetBuildStats(args *models.BuildStatOption, log *zap.SugaredLogger) (*dashboardBuild, error)
func GetBuildTotalAndSuccess ¶
func GetBuildTotalAndSuccess(args *models.BuildStatOption, log *zap.SugaredLogger) (*dashboardBuild, error)
func GetBuildTrendMeasure ¶
func GetDeployDailyTotalAndSuccess ¶
func GetDeployDailyTotalAndSuccess(args *models.DeployStatOption, log *zap.SugaredLogger) (*dashboardDeploy, error)
func GetDeployHealthMeasure ¶
func GetDeployHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*deployStatTotal, error)
func GetDeployStatByProdutName ¶ added in v1.9.9
func GetDeployStatByProdutName(productName string, startTimestamp int64, log *zap.SugaredLogger) ([]*models.DeployStat, error)
func GetDeployStats ¶ added in v1.9.9
func GetDeployStats(args *models.DeployStatOption, log *zap.SugaredLogger) (*dashboardDeploy, error)
func GetDeployTopFiveFailureMeasure ¶
func GetDeployTopFiveFailureMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployFailureHigherStat, error)
func GetDeployTopFiveHigherMeasure ¶
func GetDeployTopFiveHigherMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployHigherStat, error)
func GetDeployWeeklyMeasure ¶
func GetDeployWeeklyMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*deployStatWeekly, error)
func GetLatestTenBuildMeasure ¶
func GetLatestTenBuildMeasure(productNames []string, log *zap.SugaredLogger) ([]*buildStatLatestTen, error)
func GetPipelineHealthMeasure ¶
func GetPipelineHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*deployStatTotal, error)
func GetRequirementDeliveryLeadTime ¶ added in v1.9.9
GetRequirementDeliveryLeadTime get requirement development lead time
func GetRequirementDevelopmentLeadTime ¶ added in v1.9.9
GetRequirementDevelopmentLeadTime get requirement development lead time
func GetTenDurationMeasure ¶
func GetTestAverageMeasure ¶
func GetTestAverageMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testStatDailyArg, error)
func GetTestCaseMeasure ¶
func GetTestCaseMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testCaseStat, error)
func GetTestDashboard ¶
func GetTestDashboard(startTime, endTime int64, productName string, log *zap.SugaredLogger) (*testDashboard, error)
func GetTestDeliveryDeployMeasure ¶
func GetTestDeliveryDeployMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) ([]*testDeployStat, error)
func GetTestHealthMeasure ¶
func GetTestHealthMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*testStatTotal, error)
func GetTestStatByProdutName ¶ added in v1.9.9
func GetTestTrendMeasure ¶
func GetTestTrendMeasure(startDate, endDate int64, productNames []string, log *zap.SugaredLogger) (*testTrend, error)
func InitDeployStat ¶
func InitDeployStat(log *zap.SugaredLogger) error
func InitTestStat ¶
func InitTestStat(log *zap.SugaredLogger) error
func UpdateStatDashboardConfig ¶ added in v1.9.9
func UpdateStatDashboardConfig(id string, args *StatDashboardConfig, logger *zap.SugaredLogger) error
Types ¶
type BuildAverageDurationCalculator ¶ added in v1.9.9
func (*BuildAverageDurationCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *BuildAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type BuildFrequencyCalculator ¶ added in v1.9.9
func (*BuildFrequencyCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *BuildFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type BuildStat ¶ added in v1.9.9
type BuildStatTotal ¶ added in v1.9.9
type BuildSuccessRateCalculator ¶ added in v1.9.9
func (*BuildSuccessRateCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *BuildSuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type CurrentDay ¶
type Currently30DayBuildTrend ¶ added in v1.9.9
func GetCurrently30DayBuildTrend ¶ added in v1.9.9
func GetCurrently30DayBuildTrend(startTime, endTime int64, projects []string, logger *zap.SugaredLogger) ([]*Currently30DayBuildTrend, error)
func RebuildCurrently30DayBuildData ¶ added in v1.9.9
func RebuildCurrently30DayBuildData(start, end int64, data []*project30DayBuildData) []*Currently30DayBuildTrend
type DailyBuildStat ¶ added in v1.9.9
type DailyJobInfo ¶ added in v1.9.9
func GetProjectsOverview ¶ added in v1.9.9
func GetProjectsOverview(start, end int64, logger *zap.SugaredLogger) ([]*DailyJobInfo, error)
type DailyTestStat ¶ added in v1.9.9
type DeployAverageDurationCalculator ¶ added in v1.9.9
func (*DeployAverageDurationCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *DeployAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type DeployFrequencyCalculator ¶ added in v1.9.9
func (*DeployFrequencyCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *DeployFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type DeployStat ¶ added in v1.9.9
type DeployStat struct { ProjectName string `json:"project_name"` Success int `json:"success"` Failure int `json:"failure"` Timeout int `json:"timeout"` Total int `json:"total"` Duration int `json:"duration"` }
func GetProjectDeployStat ¶ added in v1.9.9
func GetProjectDeployStat(start, end int64, project string) (DeployStat, error)
type DeployStatTotal ¶ added in v1.9.9
type DeploySuccessRateCalculator ¶ added in v1.9.9
func (*DeploySuccessRateCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *DeploySuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type DevDelPeriod ¶ added in v1.9.9
type DevDelPeriod struct { RequirementDeliveryLeadTime float64 `json:"requirement_delivery_lead_time"` RequirementDevelopmentLeadTime float64 `json:"requirement_development_lead_time"` }
func GetRequirementDevDelPeriod ¶ added in v1.9.9
func GetRequirementDevDelPeriod(start, end int64, projects []string, logger *zap.SugaredLogger) (*DevDelPeriod, error)
type EfficiencyRadarData ¶ added in v1.9.9
type EfficiencyRadarData struct { Name string `json:"name"` TestSuccessRate float64 `json:"test_success_rate"` ReleaseFrequency float64 `json:"release_frequency"` BuildFrequency float64 `json:"build_frequency"` ReleaseSuccessRate float64 `json:"release_success_rate"` RequirementDevelopmentLeadTime float64 `json:"requirement_development_lead_time"` }
func GetEfficiencyRadar ¶ added in v1.9.9
func GetEfficiencyRadar(startTime, endTime int64, projects []string, logger *zap.SugaredLogger) ([]*EfficiencyRadarData, error)
GetEfficiencyRadar Return test pass rate, release frequency, R&D lead time within the past 30 days (if configured)
type GeneralCalculator ¶ added in v1.9.9
type GeneralCalculator struct { Host string Path string Queries []*util.KeyValue Headers []*util.KeyValue Weight int64 Function string }
GeneralCalculator gets the facts from the given API from the APIConfig and calculate the score based on Function and Weight
func (*GeneralCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *GeneralCalculator) GetWeightedScore(fact float64) (float64, error)
type MonthAttention ¶ added in v1.9.9
type MonthAttention struct { ProjectName string `json:"project_name"` Facts []*MonthAttentionData `json:"facts"` }
func GetMonthAttention ¶ added in v1.9.9
func GetMonthAttention(startTime, endTime int64, projects []string, logger *zap.SugaredLogger) ([]*MonthAttention, error)
type MonthAttentionData ¶ added in v1.9.9
type OpenAPIStatV2 ¶ added in v1.9.9
type OpenAPIStatV2 struct { Total int64 `json:"total"` SuccessCount int64 `json:"success_count"` DailyStat []*DailyStat `json:"daily_stat"` }
func CalculateReleaseStatsFromJobList ¶ added in v1.9.9
func CalculateReleaseStatsFromJobList(jobList []*commonmodels.JobInfo) *OpenAPIStatV2
func GetReleaseStatOpenAPI ¶ added in v1.9.9
func GetReleaseStatOpenAPI(startDate, endDate int64, productName string, log *zap.SugaredLogger) (*OpenAPIStatV2, error)
type Overview ¶
type Overview struct { ProjectCount int `json:"project_count"` ClusterCount int `json:"cluster_count"` ServiceCount int `json:"service_count"` WorkflowCount int `json:"workflow_count"` EnvCount int `json:"env_count"` ArtifactCount int `json:"artifact_count"` }
func GetOverviewStat ¶
func GetOverviewStat(log *zap.SugaredLogger) (*Overview, error)
type ProjectDailyBuildStat ¶ added in v1.9.9
type ProjectDailyBuildStat struct { Project string `json:"project_name"` DailyBuildStat []*DailyBuildStat `json:"daily_build_stat"` }
func GetDailyBuildMeasure ¶ added in v1.9.9
func GetDailyBuildMeasure(start, end int64, projects []string) ([]*ProjectDailyBuildStat, error)
type ProjectsBuildStatTotal ¶ added in v1.9.9
type ProjectsBuildStatTotal struct { ProjectName string `json:"project_name"` BuildStatTotal *BuildStatTotal `json:"build_stat_total"` }
func GetBuildHealthMeasureV2 ¶ added in v1.9.9
func GetBuildHealthMeasureV2(start, end int64, projects []string) ([]*ProjectsBuildStatTotal, error)
type ProjectsDailyTestStat ¶ added in v1.9.9
type ProjectsDailyTestStat struct { Project string `json:"project"` DailyTestStat []*DailyTestStat `json:"daily_test_stat"` }
func GetDailyTestStatus ¶ added in v1.9.9
func GetDailyTestStatus(start, end int64, projects []string) ([]*ProjectsDailyTestStat, error)
type ProjectsDeployStatTotal ¶ added in v1.9.9
type ProjectsDeployStatTotal struct { ProjectName string `json:"project_name"` DeployStatTotal *DeployStatTotal `json:"deploy_stat_total"` }
func GetDeployHealth ¶ added in v1.9.9
func GetDeployHealth(start, end int64, projects []string) ([]*ProjectsDeployStatTotal, error)
type ProjectsTestStatTotal ¶ added in v1.9.9
type ProjectsTestStatTotal struct { ProjectName string `json:"project_name"` TestStatTotal *TestStatTotal `json:"test_stat_total"` }
func GetTestHealth ¶ added in v1.9.9
func GetTestHealth(start, end int64, projects []string) ([]*ProjectsTestStatTotal, error)
type ProjectsWeeklyDeployStat ¶ added in v1.9.9
type ProjectsWeeklyDeployStat struct { Project string `json:"project_name"` WeeklyDeployStat []*WeeklyDeployStat `json:"weekly_deploy_stat_data"` }
func GetProjectsWeeklyDeployStat ¶ added in v1.9.9
func GetProjectsWeeklyDeployStat(start, end int64, projects []string) ([]*ProjectsWeeklyDeployStat, error)
type ProjectsWeeklyTestStat ¶ added in v1.9.9
type ProjectsWeeklyTestStat struct { Project string `json:"project"` WeeklyTestStat []*WeeklyTestStat `json:"weekly_test_stat"` }
func GetWeeklyTestStatus ¶ added in v1.9.9
func GetWeeklyTestStatus(start, end int64, projects []string) ([]*ProjectsWeeklyTestStat, error)
type ReleaseAverageDurationCalculator ¶ added in v1.9.9
func (*ReleaseAverageDurationCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *ReleaseAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type ReleaseFrequencyCalculator ¶ added in v1.9.9
func (*ReleaseFrequencyCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *ReleaseFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type ReleaseStat ¶ added in v1.9.9
type ReleaseStat struct { ProjectName string `json:"project_name"` Success int `json:"success"` Failure int `json:"failure"` Timeout int `json:"timeout"` Total int `json:"total"` Duration int `json:"duration"` }
func GetProjectReleaseStat ¶ added in v1.9.9
func GetProjectReleaseStat(start, end int64, project string) (ReleaseStat, error)
type ReleaseSuccessRateCalculator ¶ added in v1.9.9
func (*ReleaseSuccessRateCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *ReleaseSuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type StatCalculator ¶ added in v1.9.9
type StatCalculator interface { GetWeightedScore(score float64) (float64, error) // GetFact returns the fact value of the calculator, and a boolean value indicating whether the fact exists GetFact(startTime int64, endTime int64, projectKey string) (float64, bool, error) }
func CreateCalculatorFromConfig ¶ added in v1.9.9
func CreateCalculatorFromConfig(cfg *StatDashboardConfig) (StatCalculator, error)
type StatDashboardBasicData ¶ added in v1.9.9
type StatDashboardBasicData struct { BuildTotal int64 `json:"build_total"` BuildSuccess int64 `json:"build_success"` TestTotal int64 `json:"test_total"` TestSuccess int64 `json:"test_success"` DeployTotal int64 `json:"deploy_total"` DeploySuccess int64 `json:"deploy_success"` }
func GetStatsDashboardGeneralData ¶ added in v1.9.9
func GetStatsDashboardGeneralData(startTime, endTime int64, logger *zap.SugaredLogger) (*StatDashboardBasicData, error)
type StatDashboardByProject ¶ added in v1.9.9
type StatDashboardByProject struct { ProjectKey string `json:"project_key"` ProjectName string `json:"project_name"` Score float64 `json:"score"` Facts []*StatDashboardItem `json:"facts"` }
func GetStatsDashboard ¶ added in v1.9.9
func GetStatsDashboard(startTime, endTime int64, projectList []string, logger *zap.SugaredLogger) ([]*StatDashboardByProject, error)
type StatDashboardConfig ¶ added in v1.9.9
type StatDashboardConfig struct { Type string `json:"type"` ID string `json:"id"` Name string `json:"name"` Source string `json:"source"` APIConfig *APIConfig `json:"api_config,omitempty"` Function string `json:"function"` Weight int64 `json:"weight"` }
func ListDashboardConfigs ¶ added in v1.9.9
func ListDashboardConfigs(logger *zap.SugaredLogger) ([]*StatDashboardConfig, error)
type StatDashboardItem ¶ added in v1.9.9
type TaskPreview ¶ added in v1.9.9
type TestAverageDurationCalculator ¶ added in v1.9.9
func (*TestAverageDurationCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *TestAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type TestPassRateCalculator ¶ added in v1.9.9
TestPassRateCalculator is used when the data ID is "test_pass_rate" and the data source is "zadig"
func (*TestPassRateCalculator) GetWeightedScore ¶ added in v1.9.9
func (c *TestPassRateCalculator) GetWeightedScore(fact float64) (float64, error)
type TestStat ¶ added in v1.9.9
type TestStatTotal ¶ added in v1.9.9
type WeeklyBuildStat ¶ added in v1.9.9
type WeeklyBuildStat struct { Project string `json:"project"` WeeklyBuildStat []*WeeklyStat `json:"weekly_build_stat"` }
func GetWeeklyBuildStat ¶ added in v1.9.9
func GetWeeklyBuildStat(start, end int64, projects []string) ([]*WeeklyBuildStat, error)
type WeeklyDeployStat ¶ added in v1.9.9
type WeeklyStat ¶ added in v1.9.9
Source Files ¶
Click to show internal directories.
Click to hide internal directories.