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 ¶
func CreateStatDashboardConfig(args *StatDashboardConfig, logger *zap.SugaredLogger) error
func DeleteStatDashboardConfig ¶
func DeleteStatDashboardConfig(id string, logger *zap.SugaredLogger) error
func GetAllPipelineTask ¶
func GetAllPipelineTask(log *zap.SugaredLogger) error
func GetBuildDailyMeasure ¶
func GetBuildHealthMeasure ¶
func GetBuildStats ¶
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 ¶
func GetDeployStatByProdutName(productName string, startTimestamp int64, log *zap.SugaredLogger) ([]*models.DeployStat, error)
func GetDeployStats ¶
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 ¶
GetRequirementDeliveryLeadTime get requirement development lead time
func GetRequirementDevelopmentLeadTime ¶
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 ¶
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 ¶
func UpdateStatDashboardConfig(id string, args *StatDashboardConfig, logger *zap.SugaredLogger) error
Types ¶
type BuildAverageDurationCalculator ¶
func (*BuildAverageDurationCalculator) GetWeightedScore ¶
func (c *BuildAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type BuildFrequencyCalculator ¶
func (*BuildFrequencyCalculator) GetWeightedScore ¶
func (c *BuildFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type BuildStat ¶
type BuildStatTotal ¶
type BuildSuccessRateCalculator ¶
func (*BuildSuccessRateCalculator) GetWeightedScore ¶
func (c *BuildSuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type CurrentDay ¶
type Currently30DayBuildTrend ¶
func GetCurrently30DayBuildTrend ¶
func GetCurrently30DayBuildTrend(startTime, endTime int64, projects []string, logger *zap.SugaredLogger) ([]*Currently30DayBuildTrend, error)
func RebuildCurrently30DayBuildData ¶
func RebuildCurrently30DayBuildData(start, end int64, data []*project30DayBuildData) []*Currently30DayBuildTrend
type DailyBuildStat ¶
type DailyJobInfo ¶
func GetProjectsOverview ¶
func GetProjectsOverview(start, end int64, logger *zap.SugaredLogger) ([]*DailyJobInfo, error)
type DailyTestStat ¶
type DeployAverageDurationCalculator ¶
func (*DeployAverageDurationCalculator) GetWeightedScore ¶
func (c *DeployAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type DeployFrequencyCalculator ¶
func (*DeployFrequencyCalculator) GetWeightedScore ¶
func (c *DeployFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type DeployStat ¶
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 ¶
func GetProjectDeployStat(start, end int64, project string) (DeployStat, error)
type DeployStatTotal ¶
type DeploySuccessRateCalculator ¶
func (*DeploySuccessRateCalculator) GetWeightedScore ¶
func (c *DeploySuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type DevDelPeriod ¶
type DevDelPeriod struct { RequirementDeliveryLeadTime float64 `json:"requirement_delivery_lead_time"` RequirementDevelopmentLeadTime float64 `json:"requirement_development_lead_time"` }
func GetRequirementDevDelPeriod ¶
func GetRequirementDevDelPeriod(start, end int64, projects []string, logger *zap.SugaredLogger) (*DevDelPeriod, error)
type EfficiencyRadarData ¶
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 ¶
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 ¶
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 ¶
func (c *GeneralCalculator) GetWeightedScore(fact float64) (float64, error)
type MonthAttention ¶
type MonthAttention struct { ProjectName string `json:"project_name"` Facts []*MonthAttentionData `json:"facts"` }
func GetMonthAttention ¶
func GetMonthAttention(startTime, endTime int64, projects []string, logger *zap.SugaredLogger) ([]*MonthAttention, error)
type MonthAttentionData ¶
type OpenAPIStatV2 ¶
type OpenAPIStatV2 struct { Total int64 `json:"total"` SuccessCount int64 `json:"success_count"` DailyStat []*DailyStat `json:"daily_stat"` }
func CalculateReleaseStatsFromJobList ¶
func CalculateReleaseStatsFromJobList(jobList []*commonmodels.JobInfo) *OpenAPIStatV2
func GetReleaseStatOpenAPI ¶
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 ¶
type ProjectDailyBuildStat struct { Project string `json:"project_name"` DailyBuildStat []*DailyBuildStat `json:"daily_build_stat"` }
func GetDailyBuildMeasure ¶
func GetDailyBuildMeasure(start, end int64, projects []string) ([]*ProjectDailyBuildStat, error)
type ProjectsBuildStatTotal ¶
type ProjectsBuildStatTotal struct { ProjectName string `json:"project_name"` BuildStatTotal *BuildStatTotal `json:"build_stat_total"` }
func GetBuildHealthMeasureV2 ¶
func GetBuildHealthMeasureV2(start, end int64, projects []string) ([]*ProjectsBuildStatTotal, error)
type ProjectsDailyTestStat ¶
type ProjectsDailyTestStat struct { Project string `json:"project"` DailyTestStat []*DailyTestStat `json:"daily_test_stat"` }
func GetDailyTestStatus ¶
func GetDailyTestStatus(start, end int64, projects []string) ([]*ProjectsDailyTestStat, error)
type ProjectsDeployStatTotal ¶
type ProjectsDeployStatTotal struct { ProjectName string `json:"project_name"` DeployStatTotal *DeployStatTotal `json:"deploy_stat_total"` }
func GetDeployHealth ¶
func GetDeployHealth(start, end int64, projects []string) ([]*ProjectsDeployStatTotal, error)
type ProjectsTestStatTotal ¶
type ProjectsTestStatTotal struct { ProjectName string `json:"project_name"` TestStatTotal *TestStatTotal `json:"test_stat_total"` }
func GetTestHealth ¶
func GetTestHealth(start, end int64, projects []string) ([]*ProjectsTestStatTotal, error)
type ProjectsWeeklyDeployStat ¶
type ProjectsWeeklyDeployStat struct { Project string `json:"project_name"` WeeklyDeployStat []*WeeklyDeployStat `json:"weekly_deploy_stat_data"` }
func GetProjectsWeeklyDeployStat ¶
func GetProjectsWeeklyDeployStat(start, end int64, projects []string) ([]*ProjectsWeeklyDeployStat, error)
type ProjectsWeeklyTestStat ¶
type ProjectsWeeklyTestStat struct { Project string `json:"project"` WeeklyTestStat []*WeeklyTestStat `json:"weekly_test_stat"` }
func GetWeeklyTestStatus ¶
func GetWeeklyTestStatus(start, end int64, projects []string) ([]*ProjectsWeeklyTestStat, error)
type ReleaseAverageDurationCalculator ¶
func (*ReleaseAverageDurationCalculator) GetWeightedScore ¶
func (c *ReleaseAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type ReleaseFrequencyCalculator ¶
func (*ReleaseFrequencyCalculator) GetWeightedScore ¶
func (c *ReleaseFrequencyCalculator) GetWeightedScore(fact float64) (float64, error)
type ReleaseStat ¶
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 ¶
func GetProjectReleaseStat(start, end int64, project string) (ReleaseStat, error)
type ReleaseSuccessRateCalculator ¶
func (*ReleaseSuccessRateCalculator) GetWeightedScore ¶
func (c *ReleaseSuccessRateCalculator) GetWeightedScore(fact float64) (float64, error)
type StatCalculator ¶
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 ¶
func CreateCalculatorFromConfig(cfg *StatDashboardConfig) (StatCalculator, error)
type StatDashboardBasicData ¶
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 ¶
func GetStatsDashboardGeneralData(startTime, endTime int64, logger *zap.SugaredLogger) (*StatDashboardBasicData, error)
type StatDashboardByProject ¶
type StatDashboardByProject struct { ProjectKey string `json:"project_key"` ProjectName string `json:"project_name"` Score float64 `json:"score"` Facts []*StatDashboardItem `json:"facts"` }
func GetStatsDashboard ¶
func GetStatsDashboard(startTime, endTime int64, projectList []string, logger *zap.SugaredLogger) ([]*StatDashboardByProject, error)
type StatDashboardConfig ¶
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 ¶
func ListDashboardConfigs(logger *zap.SugaredLogger) ([]*StatDashboardConfig, error)
type StatDashboardItem ¶
type TaskPreview ¶
type TestAverageDurationCalculator ¶
func (*TestAverageDurationCalculator) GetWeightedScore ¶
func (c *TestAverageDurationCalculator) GetWeightedScore(fact float64) (float64, error)
type TestPassRateCalculator ¶
TestPassRateCalculator is used when the data ID is "test_pass_rate" and the data source is "zadig"
func (*TestPassRateCalculator) GetWeightedScore ¶
func (c *TestPassRateCalculator) GetWeightedScore(fact float64) (float64, error)
type TestStat ¶
type TestStatTotal ¶
type WeeklyBuildStat ¶
type WeeklyBuildStat struct { Project string `json:"project"` WeeklyBuildStat []*WeeklyStat `json:"weekly_build_stat"` }
func GetWeeklyBuildStat ¶
func GetWeeklyBuildStat(start, end int64, projects []string) ([]*WeeklyBuildStat, error)
type WeeklyDeployStat ¶
type WeeklyStat ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.